Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #3283 from MasterDuke17/make_sub_split_a_bit_more_…
…speshable

Only pass on capture in `sub split` if it's there
  • Loading branch information
jnthn committed Nov 7, 2019
2 parents 1d84c64 + 3e2cfb4 commit 726c38f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.c/Cool.pm6
Expand Up @@ -492,7 +492,7 @@ proto sub samecase($, $, *%) {*}
multi sub samecase(Cool:D $string, Cool:D $pattern) { $string.samecase($pattern) }

proto sub split($, $, |) {*}
multi sub split($pat, Cool:D $target, |c) { $target.split($pat, |c) }
multi sub split($pat, Cool:D $target, |c) { c ?? $target.split($pat, |c) !! $target.split($pat) }

proto sub chars($, *%) is pure {*}
multi sub chars(Cool $x) { $x.Str.chars }
Expand Down

0 comments on commit 726c38f

Please sign in to comment.