This is an archive of the discontinued LLVM Phabricator instance.

[ADT] edit_distance: don't return random values for empty strings (PR28780)
Needs ReviewPublic

Authored by BK1603 on Aug 30 2019, 5:57 AM.

Details

Summary

Fixes the edit_distance bug where if both the strings are
empty the algorithm returns a random integer.

Edited the already existing test and added a test for the case
when both strings are empty.

Bug link: [https://bugs.llvm.org/show_bug.cgi?id=28780]

Event Timeline

BK1603 created this revision.Aug 30 2019, 5:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2019, 5:57 AM
Herald added a subscriber: dexonsmith. · View Herald Transcript
BK1603 retitled this revision from Summary: Fixes bug 28780 [https://bugs.llvm.org/show_bug.cgi?id=28780] to Summary:Fixes bug 28780 [https://bugs.llvm.org/show_bug.cgi?id=28780].Aug 30 2019, 5:59 AM
BK1603 added reviewers: chandlerc, xiangzhai.
BK1603 retitled this revision from Summary:Fixes bug 28780 [https://bugs.llvm.org/show_bug.cgi?id=28780] to Fixes bug 28780 .
BK1603 edited the summary of this revision. (Show Details)

Please use more meaningful patch subjects, that make sense and convey the problem the patch solves.

BK1603 updated this revision to Diff 218077.Aug 30 2019, 6:04 AM
BK1603 retitled this revision from Fixes bug 28780 to Fixes bug 28780.
  1. Updating D67000: Fixes bug 28780 #
  2. Enter a brief description of the changes included in this update.
  3. The first line is used as subject, next lines as comment. #
  4. If you intended to create a new revision, use:
  5. $ arc diff --create

Added comment to the the code

BK1603 retitled this revision from Fixes bug 28780 to Fixed edit_distance returning random values for empty strings..Aug 30 2019, 6:09 AM

@lebedev.ri Sure! I hope it's better now :)

lebedev.ri retitled this revision from Fixed edit_distance returning random values for empty strings. to [ADT] edit_distance: don't return random values for empty strings (PR28780).Aug 30 2019, 6:18 AM

@lebedev.ri Thanks a lot! Will remember this for further patches :)