aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tokenizer.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/tokenizer.c b/src/tokenizer.c
index e03b441..fdb06cd 100644
--- a/src/tokenizer.c
+++ b/src/tokenizer.c
@@ -217,13 +217,8 @@ int tokenizer_consume_if(Tokenizer *self, Token expected_token, bool *result) {
}
return_if_error(tokenizer_next(self, &actual_token));
- if(actual_token == expected_token) {
- self->needs_update = bool_true;
- *result = bool_true;
- } else {
- self->needs_update = bool_false;
- *result = bool_false;
- }
+ *result = (actual_token == expected_token);
+ self->needs_update = *result;
return TOKENIZER_OK;
}