Gather data
This commit is contained in:
@@ -328,8 +328,11 @@ public record SwedishGenerator(int[] buff) {
|
||||
return new CandidateInfo(cur, curLen);
|
||||
}
|
||||
static record Slot(int key, long rs, long cs, int len) {
|
||||
|
||||
//perhaps just put len into key and use hash-code and derrive index from key. or just put both ints into tail of the two longs.
|
||||
static Slot from(int key, long rs, long cs, int len) {
|
||||
/* if ((Long.highestOneBit(rs | cs) >> 2) != (len - 1)) throw new RuntimeException();
|
||||
if ((Long.highestOneBit(cs) >> 2) != (len - 1)) throw new RuntimeException();
|
||||
if ((Long.highestOneBit(rs) >> 2) != (len - 1)) throw new RuntimeException();*/
|
||||
return new Slot(key, rs, cs, len);
|
||||
}
|
||||
|
||||
@@ -385,7 +388,7 @@ public record SwedishGenerator(int[] buff) {
|
||||
|
||||
ArrayList<Slot> extractSlots(Grid grid) {
|
||||
var slots = new ArrayList<Slot>(64);
|
||||
forEachSlot(grid, (key, rs, cs, len) -> slots.add(new Slot(key, rs, cs, len)));
|
||||
forEachSlot(grid, (key, rs, cs, len) -> slots.add(Slot.from(key, rs, cs, len)));
|
||||
return slots;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user