1
0
Fork 0
mirror of https://github.com/azalea-rs/simdnbt.git synced 2025-08-02 07:26:04 +00:00

check double capacity instead of len when extending MainTape

This commit is contained in:
mat 2025-01-18 19:54:12 +00:00
parent 576a1cc1bf
commit 646d5a33ec

View file

@ -29,7 +29,7 @@ impl<A: Allocator> MainTape<A> {
#[inline]
pub fn push(&mut self, element: TapeElement) {
if self.cur == self.end {
let old_cap = self.len();
let old_cap = self.capacity();
let extending_by = old_cap;
let new_cap = old_cap + extending_by;