introduce bitloops
This commit is contained in:
@@ -127,27 +127,6 @@ public record Export() {
|
||||
}
|
||||
}
|
||||
|
||||
static class Bit {
|
||||
|
||||
long l1, l2;
|
||||
public boolean get(int bitIndex) {
|
||||
if ((bitIndex & 64) == 0) return (l1 & (1L << bitIndex)) != 0L;
|
||||
return (l2 & (1L << (bitIndex & 63))) != 0L;
|
||||
}
|
||||
public void set(int bitIndex) {
|
||||
if ((bitIndex & 64) == 0) this.l1 |= 1L << bitIndex;
|
||||
else this.l2 |= 1L << (bitIndex & 63);
|
||||
}
|
||||
public void or(long lo, long hi) {
|
||||
this.l1 |= lo;
|
||||
this.l2 |= hi;
|
||||
}
|
||||
public void clear() {
|
||||
l1 = 0L;
|
||||
l2 = 0L;
|
||||
}
|
||||
}
|
||||
|
||||
record Bit1029(long[] bits) {
|
||||
|
||||
public Bit1029() { this(new long[2048]); }
|
||||
|
||||
Reference in New Issue
Block a user