Fix performance regression introduced in 6.8.2

This commit e6c11a0 (#19) made a big performance regression.
The reason was that parseConditional was always cloning the current state
even if no question mark (potential conditional or flow-optional
token) was at the current position.
Simply checking if questionmark matches the current token solves the problem.

Fixes #62
This commit is contained in:
Daniel Tschinder
2016-07-02 17:06:06 +02:00
parent 84b1bc52e1
commit 4e2072def8
2 changed files with 17 additions and 11 deletions

View File

@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:12)"
"throws": "Unexpected token (1:13)"
}