From: Benjamin Kramer Date: Fri, 1 Apr 2016 10:04:07 +0000 (+0000) Subject: [Lexer] Let the compiler infer string lengths. No functionality change intended. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5cf2c90de278fe9d1c2d97fb55836332e569d67;p=clang [Lexer] Let the compiler infer string lengths. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265126 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 946f36fb53..9c2a0163ac 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -2636,8 +2636,8 @@ bool Lexer::IsStartOfConflictMarker(const char *CurPtr) { return false; // Check to see if we have <<<<<<< or >>>>. - if ((BufferEnd-CurPtr < 8 || StringRef(CurPtr, 7) != "<<<<<<<") && - (BufferEnd-CurPtr < 6 || StringRef(CurPtr, 5) != ">>>> ")) + if (!StringRef(CurPtr, BufferEnd - CurPtr).startswith("<<<<<<<") && + !StringRef(CurPtr, BufferEnd - CurPtr).startswith(">>>> ")) return false; // If we have a situation where we don't care about conflict markers, ignore