diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-05-09 16:22:31 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-05-09 16:22:31 +0000 |
commit | e46dd48e9fe535825bc81e44c8863b0ee5b44354 (patch) | |
tree | b05626249449a9e3a09ddf63372c245db034f979 /clang/lib/AST/CommentCommandTraits.cpp | |
parent | 90a4c23274a94fbdad21ca3bbc79c71e697a82b8 (diff) | |
download | bcm5719-llvm-e46dd48e9fe535825bc81e44c8863b0ee5b44354.tar.gz bcm5719-llvm-e46dd48e9fe535825bc81e44c8863b0ee5b44354.zip |
[doc parsing]: don't attempt to fix single character
commands (\t \n are common). \\ rdar://12381408
llvm-svn: 181517
Diffstat (limited to 'clang/lib/AST/CommentCommandTraits.cpp')
-rw-r--r-- | clang/lib/AST/CommentCommandTraits.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/CommentCommandTraits.cpp b/clang/lib/AST/CommentCommandTraits.cpp index dc4744a53c5..2b5e624fb71 100644 --- a/clang/lib/AST/CommentCommandTraits.cpp +++ b/clang/lib/AST/CommentCommandTraits.cpp @@ -49,6 +49,10 @@ HelperTypoCorrectCommandInfo(SmallVectorImpl<const CommandInfo *> &BestCommand, const unsigned MaxEditDistance = 1; unsigned BestEditDistance = MaxEditDistance + 1; StringRef Name = Command->Name; + // Don't attempt trying to typo fix single character commands. + // \t and \n are very common + if (Name.size() <= 1) + return; unsigned MinPossibleEditDistance = abs((int)Name.size() - (int)Typo.size()); if (MinPossibleEditDistance > 0 && |