From ec3a17af9c23f2ccb385517e499da146a5939d9f Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Fri, 17 Feb 2023 15:15:23 -0600 Subject: [PATCH] [ares][hamt] shift off 5 bits per level on insert, not 1 --- rust/ares/src/hamt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ares/src/hamt.rs b/rust/ares/src/hamt.rs index 59f2bee..3a4d7fd 100644 --- a/rust/ares/src/hamt.rs +++ b/rust/ares/src/hamt.rs @@ -242,7 +242,7 @@ impl Hamt { // get the mug chunk for the noun at *the next level* so // we can build a fake stem for it let fake_mug = mug_u32(stack, (*leaf.buffer).0); - let fake_chunk = (fake_mug >> (depth + 1)) & 0x1F; + let fake_chunk = (fake_mug >> ((depth + 1) * 5)) & 0x1F; let next_stem = Stem { bitmap: chunk_to_bit(fake_chunk), typemap: 0,