Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't bother handling the $limit case
We need to build the entire structure in memory anyway.
  • Loading branch information
lizmat committed Nov 5, 2015
1 parent de715e9 commit 64bd8a5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/Str.pm
Expand Up @@ -1099,10 +1099,9 @@ my class Str does Stringy { # declared in BOOTSTRAP
$result
}
multi method split(Str:D: @needles,$parts;; :$all, :$keep-indices) {
my @result = self.split(@needles,:$all,:$keep-indices);
nqp::istype($parts,Whatever) || $parts === Inf
?? @result
!! @result.head($all || $keep-indices ?? $parts + $parts !! $parts)
?? self.split(@needles,:$all,:$keep-indices)
!! self.split(/ @needles /,$parts,:$all,:$keep-indices)
}

method samecase(Str:D: Str $pattern) {
Expand Down

0 comments on commit 64bd8a5

Please sign in to comment.