Skip to content

Commit

Permalink
Merge :global and :g in Str.subst
Browse files Browse the repository at this point in the history
Not sure why they were separated, but they needn't be now
  • Loading branch information
lizmat committed Oct 24, 2016
1 parent 1794328 commit 1c67e3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/Str.pm
Expand Up @@ -1068,14 +1068,14 @@ my class Str does Stringy { # declared in BOOTSTRAP
}
}

multi method subst(Str:D: $matcher, $replacement, :$global, :$g,
multi method subst(Str:D: $matcher, $replacement, :global(:$g),
:ii(:$samecase), :ss(:$samespace), :mm(:$samemark),
*%options) {

# take the fast lane if we can
return Rakudo::Internals.TRANSPOSE(self,$matcher,$replacement)
if nqp::istype($matcher,Str) && nqp::istype($replacement,Str)
&& ($g || $global)
&& $g
&& !$samecase && !$samespace && !$samemark && !%options;

my $caller_dollar_slash := nqp::getlexcaller('$/');
Expand All @@ -1084,7 +1084,7 @@ my class Str does Stringy { # declared in BOOTSTRAP

# nothing to do
try $caller_dollar_slash = $/ if $SET_DOLLAR_SLASH;
my @matches = self.match($matcher, :g($g || $global), |%options);
my @matches = self.match($matcher, :$g, |%options);

nqp::istype(@matches[0], Failure)
?? @matches[0]
Expand Down

0 comments on commit 1c67e3b

Please sign in to comment.