1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 20:47:46 +00:00

improve memory usage estimation

This commit is contained in:
Michael Debertol 2021-05-02 17:27:44 +02:00
parent 484558e37d
commit dc5bd9f0be

View file

@ -281,7 +281,9 @@ pub struct Line {
impl Line {
pub fn estimate_size(&self) -> usize {
self.line.capacity() + self.selections.capacity() * std::mem::size_of::<Selection>()
self.line.capacity()
+ self.selections.capacity() * std::mem::size_of::<Selection>()
+ std::mem::size_of::<Self>()
}
pub fn new(line: String, settings: &GlobalSettings) -> Self {