Fix memory leak in ArrayList
This commit is contained in:
parent
c9d9e80acb
commit
bbfe79fa57
|
@ -298,7 +298,7 @@ mod array_list {
|
|||
pub fn pop_back(&mut self) -> Option<T> {
|
||||
self.length -= 1;
|
||||
let current_idx = self.next_idx();
|
||||
if self.length >= BLOCK_SIZE && current_idx == 0 {
|
||||
if current_idx == 0 {
|
||||
let last_list = self.inner.pop_back()?;
|
||||
return Some(last_list[0].clone());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue