]> granicus.if.org Git - clang/commit
[Sema] Make typo correction slightly more efficient
authorFangrui Song <maskray@google.com>
Sun, 9 Sep 2018 17:20:03 +0000 (17:20 +0000)
committerFangrui Song <maskray@google.com>
Sun, 9 Sep 2018 17:20:03 +0000 (17:20 +0000)
commit51bf0d9b64c8a4a277eef2343456f9a14b38a0ef
treeeb8c063410cbd4c8d130680ee6c6ddb3b8cd91ed
parenta2f63564c9917cc72d6cb557db119e6390149e41
[Sema] Make typo correction slightly more efficient

edit_distance returns UpperBound+1 if the distance will exceed UpperBound. We can subtract 1 from UpperBound and change >= to > in the if condition. The threshold does not change but edit_distance will have more opportunity to bail out earlier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341763 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaLookup.cpp