Skip to content

Commit

Permalink
Remove unreachable candidates
Browse files Browse the repository at this point in the history
Since the nameds are optional, the candidates without nameds will
never be reached.  So they can be removed.  The alternative would
be to create candidates with required nameds, but that would lead
to a great many candidates, and since most of the work isn't done
here anyway, and one should use the method way in general anyway
if one is interested in performance, leaving it like this seems
to be the best compromise.
  • Loading branch information
lizmat committed Feb 14, 2020
1 parent 7cb0481 commit 0761a88
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/core.c/Cool.pm6
Expand Up @@ -479,16 +479,10 @@ multi sub index(Cool:D $s,
Cool:D $needle, :i(:$ignorecase), :m(:$ignoremark) --> Int:D) {
$s.Str.index($needle.Str, :$ignorecase, :$ignoremark)
}
multi sub index(Cool:D $s, Cool:D $needle --> Int:D) {
$s.Str.index($needle.Str)
}
multi sub index(Cool:D $s,
Cool:D $needle, Cool:D $pos, :i(:$ignorecase), :m(:$ignoremark) --> Int:D) {
$s.Str.index($needle.Str,$pos.Int, :$ignorecase, :$ignoremark)
}
multi sub index(Cool:D $s, Cool:D $needle, Cool:D $pos --> Int:D) {
$s.Str.index($needle.Str,$pos.Int)
}

proto sub rindex($, $, $?, *%) {*}
multi sub rindex(Cool:D $s, Cool:D $needle --> Int:D) {
Expand Down

0 comments on commit 0761a88

Please sign in to comment.