Skip to content

Commit

Permalink
simplify .match(:x) implementation a wee bit
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed May 18, 2010
1 parent cf5afac commit 72ed16f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Cool-str.pm
Expand Up @@ -191,7 +191,7 @@ augment class Cool {
my %opts;
%opts<p> = $p if defined $p;
%opts<c> = $continue // 0 unless defined $p;
my $x_upper = 0;
my $x_upper = -1;
if defined($x) {
if $x ~~ Range {
$x_upper = $x.excludes_max ?? $x.max - 1 !! $x.max;
Expand All @@ -214,7 +214,7 @@ augment class Cool {
take $m-copy;
$taken++;
}
last if $x.defined && $taken == $x_upper;
last if $taken == $x_upper;

if ($overlap) {
%opts<c> = $m.from + 1;
Expand Down

0 comments on commit 72ed16f

Please sign in to comment.