Skip to content

Commit

Permalink
Call !match-list directly in split
Browse files Browse the repository at this point in the history
Rather than going through .match with all of its related checks along
the way.
  • Loading branch information
jnthn committed Jun 10, 2019
1 parent ce30ff2 commit bed0695
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Str.pm6
Expand Up @@ -1479,7 +1479,8 @@ my class Str does Stringy { # declared in BOOTSTRAP
return Seq.new(Rakudo::Iterator.Empty) if $limit <= 0;

my \matches = $limit == Inf
?? self.match($pat, :g)
?? self!match-list($/, $pat($cursor-init(Match,self,:0c)),
CURSOR-GLOBAL, POST-MATCH)
!! self.match($pat, :x(1..$limit-1));

my str $str = nqp::unbox_s(self);
Expand Down

0 comments on commit bed0695

Please sign in to comment.