From ab89ef6aa7b8fef0eb410949c86a25e55586a972 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 23 Nov 2018 01:33:32 +0100 Subject: Get rid of _next_token() and _peek_token() These are pretty hot. Inline them to save a few % of parsing time. They're pretty simple anyway. _tokens_i was initialized to -1 to simplify the _next_token() implementation. With _next_token() gone, initialize it to 0 instead, which simplifies some other code. --- testsuite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite.py') diff --git a/testsuite.py b/testsuite.py index 22e12cc..336fa65 100644 --- a/testsuite.py +++ b/testsuite.py @@ -1260,7 +1260,7 @@ tests/Krecursive2:1 def verify_split(to_split, op, operand_strs): # The same hackage as in Kconfig.eval_string() c._tokens = c._tokenize("if " + to_split)[1:] - c._tokens_i = -1 + c._tokens_i = 0 operands = split_expr(c._parse_expr(False), op) -- cgit v1.2.3