introduce bitloops
This commit is contained in:
@@ -58,11 +58,11 @@ public record Export() {
|
||||
static long pack(int r, int c) { return (((long) r) << 32) ^ (c & 0xFFFFFFFFL); }
|
||||
long l1, l2;
|
||||
public boolean get(int bitIndex) {
|
||||
if (bitIndex < 64) return (l1 & (1L << bitIndex)) != 0L;
|
||||
if ((bitIndex & 64) == 0) return (l1 & (1L << bitIndex)) != 0L;
|
||||
return (l2 & (1L << (bitIndex & 63))) != 0L;
|
||||
}
|
||||
public void set(int bitIndex) {
|
||||
if (bitIndex < 64) this.l1 |= 1L << bitIndex;
|
||||
if ((bitIndex & 64) == 0) this.l1 |= 1L << bitIndex;
|
||||
else this.l2 |= 1L << (bitIndex & 63);
|
||||
}
|
||||
public void clear() {
|
||||
|
||||
Reference in New Issue
Block a user