Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Small cleanup I forgot just now
  • Loading branch information
lizmat committed Feb 20, 2015
1 parent 32523c1 commit bf00eff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/Str.pm
Expand Up @@ -670,9 +670,9 @@ my class Str does Stringy { # declared in BOOTSTRAP

my $caller_dollar_slash := nqp::getlexcaller('$/');
my $SET_DOLLAR_SLASH = $SET_CALLER_DOLLAR_SLASH || nqp::istype($matcher, Regex);
try $caller_dollar_slash = $/ if $SET_DOLLAR_SLASH;

# nothing to do
try $caller_dollar_slash = $/ if $SET_DOLLAR_SLASH;
my @matches = self.match($matcher, |%options);
return self if !@matches || (@matches == 1 && !@matches[0]);

Expand All @@ -682,6 +682,7 @@ my class Str does Stringy { # declared in BOOTSTRAP

# need to do something special
if $SET_DOLLAR_SLASH || $samecase || $samespace || nqp::istype($replacement,Callable) {

for @matches -> $m {
try $caller_dollar_slash = $m if $SET_DOLLAR_SLASH;
nqp::push_s(
Expand All @@ -696,8 +697,7 @@ my class Str does Stringy { # declared in BOOTSTRAP
nqp::push_s($result,nqp::unbox_s($real_replacement));
$prev = nqp::unbox_i($m.to);
}
my $last = @matches.pop;
nqp::push_s($result,nqp::substr($str,nqp::unbox_i($last.to)));
nqp::push_s($result,nqp::substr($str,$prev));
nqp::p6box_s(nqp::join('',$result));
}

Expand Down

0 comments on commit bf00eff

Please sign in to comment.