Skip to content

Commit

Permalink
One less native integer increment in is-sha1
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 13, 2024
1 parent ed66a48 commit 4d801e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/String/Utils.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ my sub chomp-needle(str $haystack, str $needle) {
}

my sub is-sha1(str $needle) {
my int $i = -1;
my int $i;
if nqp::chars($needle) == 40 {
my $map := BEGIN {
my int @map;
Expand All @@ -156,9 +156,9 @@ my sub is-sha1(str $needle) {
}

nqp::while(
nqp::isle_i(++$i,40)
nqp::isle_i($i,40)
&& nqp::atpos_i($map,nqp::ordat($needle,$i)),
nqp::null
++$i
)
}

Expand Down

0 comments on commit 4d801e6

Please sign in to comment.