mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
Optimize regex match iterator.
Reuse virtual machine and capture groups between matches.
This commit is contained in:
@@ -1126,9 +1126,8 @@ test_match_iterator :: proc(t: ^testing.T) {
|
||||
testing.expect_value(t, err, nil)
|
||||
(err == nil) or_continue
|
||||
|
||||
count: int
|
||||
for capture, idx in regex.match(&it) {
|
||||
if count > len(test.expected) {
|
||||
if idx >= len(test.expected) {
|
||||
break
|
||||
}
|
||||
check_capture(t, capture, test.expected[idx])
|
||||
|
||||
Reference in New Issue
Block a user