summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CommentCommandTraits.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-05-09 16:22:31 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-05-09 16:22:31 +0000
commite46dd48e9fe535825bc81e44c8863b0ee5b44354 (patch)
treeb05626249449a9e3a09ddf63372c245db034f979 /clang/lib/AST/CommentCommandTraits.cpp
parent90a4c23274a94fbdad21ca3bbc79c71e697a82b8 (diff)
downloadbcm5719-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.cpp4
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 &&
OpenPOWER on IntegriCloud