Refactor time info, update zobrist to tuple struct, naming and clippy
This commit is contained in:
@@ -17,15 +17,15 @@ impl TranspositionTable {
|
||||
pub fn lookup(&self, zobrist_hash: ZobristHash) -> Option<&TTEntry> {
|
||||
let entry = self
|
||||
.positions
|
||||
.get((zobrist_hash.hash % self.size) as usize)
|
||||
.get((zobrist_hash.0 % self.size) as usize)
|
||||
.and_then(|entry| entry.as_ref());
|
||||
|
||||
entry
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, tt_entry: TTEntry) {
|
||||
let index = (tt_entry.hash.hash % self.size) as usize;
|
||||
self.positions[index] = Some(tt_entry);
|
||||
let idx = (tt_entry.hash.0 % self.size) as usize;
|
||||
self.positions[idx] = Some(tt_entry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user