Make IndexVec::ensure_contains_elem
return a reference to the element
This commit is contained in:
parent
e49122fb1c
commit
e1cd99f6ff
6 changed files with 24 additions and 26 deletions
|
@ -413,8 +413,8 @@ impl<I: Idx, const N: usize, T: FixedSizeEncoding<ByteArray = [u8; N]>> TableBui
|
|||
// > Space requirements could perhaps be optimized by using the HAMT `popcnt`
|
||||
// > trick (i.e. divide things into buckets of 32 or 64 items and then
|
||||
// > store bit-masks of which item in each bucket is actually serialized).
|
||||
self.blocks.ensure_contains_elem(i, || [0; N]);
|
||||
value.write_to_bytes(&mut self.blocks[i]);
|
||||
let block = self.blocks.ensure_contains_elem(i, || [0; N]);
|
||||
value.write_to_bytes(block);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue