Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
micro opt tweak in Str.lines
  • Loading branch information
lizmat committed Sep 10, 2014
1 parent 9c7b2fd commit 0e7397d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/Str.pm
Expand Up @@ -725,8 +725,7 @@ my class Str does Stringy { # declared in BOOTSTRAP
take $chars
?? nqp::box_s( nqp::substr( $ns, $prev + 1, $chars ), Str )
!! '';
$prev = $curr;
$prev = $prev + nqp::eqat( $ns, $LF, $curr + 1 );
$prev = $curr + nqp::eqat( $ns, $LF, $curr + 1 );
}

# now search for LF
Expand Down Expand Up @@ -759,8 +758,7 @@ my class Str does Stringy { # declared in BOOTSTRAP
take $chars
?? nqp::box_s( nqp::substr( $ns, $prev + 1, $chars ), Str )
!! '';
$prev = $curr;
$prev = $prev + 1 if nqp::substr($ns,$curr+1,1) eq $LF;
$prev = $curr + nqp::eqat( $ns, $LF, $curr + 1 );
$count = $count - 1;
}

Expand Down

0 comments on commit 0e7397d

Please sign in to comment.