aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-192/james-smith/perl/ch-1.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-192/james-smith/perl/ch-1.pl b/challenge-192/james-smith/perl/ch-1.pl
index bc94462d44..4a347bc343 100644
--- a/challenge-192/james-smith/perl/ch-1.pl
+++ b/challenge-192/james-smith/perl/ch-1.pl
@@ -15,6 +15,6 @@ done_testing();
sub binary_flip {
my($r,$k,$n) = (0,1,shift);
- $r=(1-$n&1)*$k+$r,$k<<=1,$n>>=1 while $n;
+ $r|=(~$n&1)<<$k++, $n>>=1 while $n;
$r;
}