From e6d960aa5013ea8ec0ab43e28f90e4c7a635a59b Mon Sep 17 00:00:00 2001 From: despiegk Date: Sun, 27 Oct 2024 15:41:59 +0100 Subject: [PATCH] ... --- research/datastructures/sync/sync.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/research/datastructures/sync/sync.v b/research/datastructures/sync/sync.v index 752cac961..fdca5bfdb 100644 --- a/research/datastructures/sync/sync.v +++ b/research/datastructures/sync/sync.v @@ -69,15 +69,15 @@ pub fn new_buzhash() BuzHash { // Update the rolling hash with a new byte [direct_array_access; inline] -pub fn (mut b BuzHash) update(byte u8) u32 { +pub fn (mut b BuzHash) update(b u8) u32 { if b.full { old_byte := b.window[b.pos] b.hash = (b.hash << 1) | (b.hash >> 31) // Rotate left by 1 b.hash ^= b.lookup_table[old_byte] } - b.hash ^= b.lookup_table[byte] - b.window[b.pos] = byte + b.hash ^= b.lookup_table[b] + b.window[b.pos] = b b.pos++ if b.pos == window_size {