Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Oops, we need an if instead a while here
timotimo++ for spotting.  No noticeable performance difference, though
  • Loading branch information
lizmat committed Sep 23, 2015
1 parent c43ac75 commit 3970634
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Str.pm
Expand Up @@ -659,7 +659,7 @@ my class Str does Stringy { # declared in BOOTSTRAP
my int $nextpos;
my int $length;

while ($left = $!chars - $!pos) > 0 {
if ($left = $!chars - $!pos) > 0 {
$nextpos = nqp::findcclass(
nqp::const::CCLASS_NEWLINE, $!str, $!pos, $left);

Expand Down Expand Up @@ -905,7 +905,7 @@ my class Str does Stringy { # declared in BOOTSTRAP
my int $left;
my int $nextpos;

while ($left = $!chars - $!pos) > 0 {
if ($left = $!chars - $!pos) > 0 {
$nextpos = nqp::findcclass(
nqp::const::CCLASS_WHITESPACE, $!str, $!pos, $left);

Expand Down

0 comments on commit 3970634

Please sign in to comment.