[lld] r284806 - Simplify. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 20 21:52:13 PDT 2016
Author: ruiu
Date: Thu Oct 20 23:52:13 2016
New Revision: 284806
URL: http://llvm.org/viewvc/llvm-project?rev=284806&view=rev
Log:
Simplify. NFC.
Modified:
lld/trunk/ELF/ScriptParser.cpp
Modified: lld/trunk/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ScriptParser.cpp?rev=284806&r1=284805&r2=284806&view=diff
==============================================================================
--- lld/trunk/ELF/ScriptParser.cpp (original)
+++ lld/trunk/ELF/ScriptParser.cpp Thu Oct 20 23:52:13 2016
@@ -138,16 +138,11 @@ StringRef ScriptParserBase::peek() {
}
bool ScriptParserBase::consume(StringRef Tok) {
- if (Error)
- return false;
- if (atEOF()) {
- setError("unexpected EOF");
- return false;
+ if (peek() == Tok) {
+ skip();
+ return true;
}
- if (Tokens[Pos] != Tok)
- return false;
- ++Pos;
- return true;
+ return false;
}
void ScriptParserBase::skip() { (void)next(); }
More information about the llvm-commits
mailing list