Skip to content

Commit

Permalink
optimize toBitArray function (#212)
Browse files Browse the repository at this point in the history
Remove extra bitwise operator
  • Loading branch information
fanatid authored Jul 7, 2019
1 parent 44650ad commit 7ba7a8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bn.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@
var off = (bit / 26) | 0;
var wbit = bit % 26;

w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;
w[bit] = (num.words[off] >>> wbit) & 0x01;
}

return w;
Expand Down

0 comments on commit 7ba7a8c

Please sign in to comment.