Skip to content

Commit

Permalink
[Any.match] remove some duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed May 18, 2010
1 parent 72ed16f commit 6aedf5e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/core/Cool-str.pm
Expand Up @@ -205,12 +205,7 @@ augment class Cool {
my $i = 1;
my @r = gather while my $m = Regex::Cursor.parse(self, :rule($pat), |%opts) {
my $m-copy = $m;
if $nth.defined {
if $i ~~ any(|$nth) {
take $m-copy;
$taken++;
}
} else {
unless $nth.defined && ($i !~~ any |$nth) {
take $m-copy;
$taken++;
}
Expand Down

0 comments on commit 6aedf5e

Please sign in to comment.