r265126 - [Lexer] Let the compiler infer string lengths. No functionality change intended.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 1 03:04:07 PDT 2016


Author: d0k
Date: Fri Apr  1 05:04:07 2016
New Revision: 265126

URL: http://llvm.org/viewvc/llvm-project?rev=265126&view=rev
Log:
[Lexer] Let the compiler infer string lengths. No functionality change intended.

Modified:
    cfe/trunk/lib/Lex/Lexer.cpp

Modified: cfe/trunk/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=265126&r1=265125&r2=265126&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Lexer.cpp (original)
+++ cfe/trunk/lib/Lex/Lexer.cpp Fri Apr  1 05:04:07 2016
@@ -2636,8 +2636,8 @@ bool Lexer::IsStartOfConflictMarker(cons
     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




More information about the cfe-commits mailing list