Skip to content

Commit dceb34b

Browse files
committed
Simplify and improve performance of !alt a bit; creates less junk. ~4% improvement on CORE.setting parse time.
1 parent 6be8ad9 commit dceb34b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/QRegex/Cursor.nqp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,12 @@ role NQPCursorRole {
228228
my @order := $nfa.run($!target, $pos);
229229

230230
# Push points onto the bstack.
231-
my $i := 0;
232-
my $num_matched := nqp::elems(@order);
233231
my $caps := $!cstack ?? nqp::elems($!cstack) !! 0;
234-
while $i < $num_matched {
235-
#say("Pushing fate " ~ @fates[@order[$i]]);
236-
nqp::push_i($!bstack, @fates[@order[$i]]);
232+
while @order {
233+
nqp::push_i($!bstack, nqp::atpos_i(@fates, nqp::shift_i(@order)));
237234
nqp::push_i($!bstack, $pos);
238235
nqp::push_i($!bstack, 0);
239236
nqp::push_i($!bstack, $caps);
240-
$i := $i + 1;
241237
}
242238
}
243239

0 commit comments

Comments
 (0)