Skip to content

Commit c93554b

Browse files
committed
[ELF] Simplify ScriptLexer::consume. NFC
1 parent a23efcc commit c93554b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lld/ELF/ScriptLexer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,9 @@ StringRef ScriptLexer::peek2() {
282282
}
283283

284284
bool ScriptLexer::consume(StringRef tok) {
285-
if (peek() == tok) {
286-
skip();
285+
if (next() == tok)
287286
return true;
288-
}
287+
--pos;
289288
return false;
290289
}
291290

0 commit comments

Comments
 (0)