From 7cef3758728ce8e2f86217d195f3a569c31151ff Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Thu, 21 Mar 2024 18:10:54 +0800 Subject: [PATCH] rename `kv_heap_size` to `heap_size` Signed-off-by: Richard Chien --- src/common/estimate_size/src/collections/vec.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/common/estimate_size/src/collections/vec.rs b/src/common/estimate_size/src/collections/vec.rs index 6064cbfbfe3a6..ac9f766ee1ec6 100644 --- a/src/common/estimate_size/src/collections/vec.rs +++ b/src/common/estimate_size/src/collections/vec.rs @@ -17,21 +17,21 @@ use crate::EstimateSize; #[derive(Clone)] pub struct EstimatedVec { inner: Vec, - kv_heap_size: usize, + heap_size: usize, } impl Default for EstimatedVec { fn default() -> Self { Self { inner: vec![], - kv_heap_size: 0, + heap_size: 0, } } } impl EstimateSize for EstimatedVec { fn estimated_heap_size(&self) -> usize { - self.kv_heap_size + self.heap_size } } @@ -41,9 +41,7 @@ impl EstimatedVec { } pub fn push(&mut self, value: T) { - self.kv_heap_size = self - .kv_heap_size - .saturating_add(value.estimated_heap_size()); + self.heap_size = self.heap_size.saturating_add(value.estimated_heap_size()); self.inner.push(value); }