Refactor time info, update zobrist to tuple struct, naming and clippy

This commit is contained in:
stefiosif
2025-01-26 20:16:01 +02:00
parent 36aa30ea17
commit 53beda7fe3
11 changed files with 78 additions and 77 deletions

View File

@@ -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);
}
}