diff --git a/src/treemap/inherent.rs b/src/treemap/inherent.rs index 45badbce..aad5f564 100644 --- a/src/treemap/inherent.rs +++ b/src/treemap/inherent.rs @@ -46,7 +46,7 @@ impl RoaringTreemap { /// ``` pub fn insert(&mut self, value: u64) -> bool { let (hi, lo) = util::split(value); - self.map.entry(hi).or_insert_with(RoaringBitmap::new).insert(lo) + self.map.entry(hi).or_default().insert(lo) } /// Inserts a range of values. @@ -81,11 +81,11 @@ impl RoaringTreemap { // Calculate the sub-range from the lower 32 bits counter += if hi == end_hi && hi == start_hi { - entry.or_insert_with(RoaringBitmap::new).insert_range(start_lo..=end_lo) + entry.or_default().insert_range(start_lo..=end_lo) } else if hi == start_hi { - entry.or_insert_with(RoaringBitmap::new).insert_range(start_lo..=u32::MAX) + entry.or_default().insert_range(start_lo..=u32::MAX) } else if hi == end_hi { - entry.or_insert_with(RoaringBitmap::new).insert_range(0..=end_lo) + entry.or_default().insert_range(0..=end_lo) } else { // We insert a full bitmap if it doesn't already exist and return the size of it. // But if the bitmap already exists at this spot we replace it with a full bitmap @@ -122,7 +122,7 @@ impl RoaringTreemap { /// ``` pub fn push(&mut self, value: u64) -> bool { let (hi, lo) = util::split(value); - self.map.entry(hi).or_insert_with(RoaringBitmap::new).push(lo) + self.map.entry(hi).or_default().push(lo) } /// Pushes `value` in the treemap only if it is greater than the current maximum value.