projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e550bbd
)
[Lexer] Let the compiler infer string lengths. No functionality change intended.
author
Benjamin Kramer
<benny.kra@googlemail.com>
Fri, 1 Apr 2016 10:04:07 +0000
(10:04 +0000)
committer
Benjamin Kramer
<benny.kra@googlemail.com>
Fri, 1 Apr 2016 10:04:07 +0000
(10:04 +0000)
llvm-svn: 265126
clang/lib/Lex/Lexer.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Lex/Lexer.cpp
b/clang/lib/Lex/Lexer.cpp
index
946f36f
..
9c2a016
100644
(file)
--- a/
clang/lib/Lex/Lexer.cpp
+++ b/
clang/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