From ae68c3d273a8390fee282d17b39d9782fb64ce5e Mon Sep 17 00:00:00 2001 From: nitely Date: Fri, 25 Aug 2023 05:18:47 -0300 Subject: [PATCH] ORC speedup --- src/regex/nfamatch2.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/regex/nfamatch2.nim b/src/regex/nfamatch2.nim index f3e1bdc..600c079 100644 --- a/src/regex/nfamatch2.nim +++ b/src/regex/nfamatch2.nim @@ -80,7 +80,8 @@ template nextStateTpl(bwMatch = false): untyped {.dirty.} = if not smB.hasState n: smB.add (n, capt, bounds) break - for nti, nt in pairs nfa.s[n].next: + # issue #125 + for nti, nt in pairs toOpenArray(nfa.s[n].next, 0, nfa.s[n].next.len-1): if smB.hasState nt: continue if not match(nfa.s[nt], c):