Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove superfluous -if-
  • Loading branch information
lizmat committed Nov 7, 2013
1 parent d916dbe commit 158e905
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/core/Str.pm
Expand Up @@ -698,25 +698,22 @@ my class Str does Stringy { # declared in BOOTSTRAP
my $c = 0;
my $l = $limit ~~ Whatever ?? $Inf !! $limit - 1;
return ().list if $l < 0;
if $l >= 0 {
gather {
while $l-- > 0 {
if ($match-string eq "") {
last unless $c + 1 < self.chars;
take self.substr($c, 1);
$c++;
} else {
my $m = self.index($match-string, $c);
last unless $m.defined;
take self.substr($c, $m - $c);
take $match-string if $all;
$c = $m + $match-string.chars;
}

gather {
while $l-- > 0 {
if ($match-string eq "") {
last unless $c + 1 < self.chars;
take self.substr($c, 1);
$c++;
} else {
my $m = self.index($match-string, $c);
last unless $m.defined;
take self.substr($c, $m - $c);
take $match-string if $all;
$c = $m + $match-string.chars;
}
take self.substr($c);
}
} else {
Nil;
take self.substr($c);
}
}

Expand Down

0 comments on commit 158e905

Please sign in to comment.