diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-04-29 07:00:52 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-29 20:25:56 +0200 |
commit | cf4935e80602ebe9335dc9223f276c56918e3218 (patch) | |
tree | dc64e914aed320c24cf500509a0d3fe63678fd35 /Userland/Shell | |
parent | 0d742557c6e314263fe775fc1057c990d6eb1fd7 (diff) | |
download | serenity-cf4935e80602ebe9335dc9223f276c56918e3218.zip |
Shell: Avoid position push/pop when checking for next_is()
This operation is not a rule and cannot produce nodes.
Diffstat (limited to 'Userland/Shell')
-rw-r--r-- | Userland/Shell/Parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Shell/Parser.cpp b/Userland/Shell/Parser.cpp index d1e422f6d8..699de495ae 100644 --- a/Userland/Shell/Parser.cpp +++ b/Userland/Shell/Parser.cpp @@ -1867,9 +1867,9 @@ StringView Parser::consume_while(Function<bool(char)> condition) bool Parser::next_is(const StringView& next) { - auto start = push_start(); + auto start = current_position(); auto res = expect(next); - restore_to(*start); + restore_to(start.offset, start.line); return res; } |