Fix memory leak in ArrayList

This commit is contained in:
kngwyu 2018-12-26 20:18:02 +09:00
parent c9d9e80acb
commit bbfe79fa57
1 changed files with 1 additions and 1 deletions

View File

@ -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());
}