From fc75bd874972eebad490dfc2b35121a54f234c2f Mon Sep 17 00:00:00 2001 From: Drahflow Date: Sun, 14 Aug 2016 21:50:48 +0200 Subject: Remove some (potential) source of O(n^2) --- elymas/lib/parser.ey | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'elymas') diff --git a/elymas/lib/parser.ey b/elymas/lib/parser.ey index 8cccee1..d5319d3 100644 --- a/elymas/lib/parser.ey +++ b/elymas/lib/parser.ey @@ -308,7 +308,7 @@ i 1 add results * { i results * # collected outside the loop }' { - [ i results * ] waitingStates cat =waitingStates + [ waitingStates i results * ] =waitingStates }' ? * }' loop } each ] _ =executingStates len @@ -320,7 +320,12 @@ # "<<<---" dump }' { }" loop - waitingStates _ =states + [ + { waitingStates len }" { + 1 waitingStates * + 0 waitingStates * =waitingStates + }" loop + ] _ =states }' > -- } /run deffst > -- cgit v1.2.3