From fadaaa2eeea8e44f7677f657c198c0b41dde55b3 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 6064cbfbfe3a..ac9f766ee1ec 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); }