Skip to content

Commit a07059a

Browse files
committed
Merge pull request #2 from mbakkar/patch-1
A tiny optimization for Utils.bit()
2 parents dc9e2cf + fefe3ff commit a07059a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net/i2p/crypto/eddsa/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static int negative(int b) {
3434
* @return 0 or 1, the value of the i'th bit in h
3535
*/
3636
public static int bit(byte[] h, int i) {
37-
return (h[i/8] >> (i%8)) & 1;
37+
return (h[i >> 3] >> (i & 7)) & 1;
3838
}
3939

4040
/**

0 commit comments

Comments
 (0)