Skip to content

Commit c78fddf

Browse files
committed
Cache the NFAs built for proto-regexes so we don't have to re-build them every time we run the protoregex.
1 parent 672d080 commit c78fddf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/QRegex/Cursor.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ role NQPCursorRole {
118118
}
119119

120120
method !protoregex($name) {
121-
my $nfa := self.'!protoregex_nfa'($name);
121+
my $nfa := self.HOW.cache(self, $name, { self.'!protoregex_nfa'($name) });
122122
my @fatepos := $nfa.run($!target, $!pos);
123123
my $cur;
124124
if @fatepos {

0 commit comments

Comments
 (0)