@@ -46,7 +46,7 @@ impl RoaringTreemap {
4646 /// ```
4747 pub fn insert ( & mut self , value : u64 ) -> bool {
4848 let ( hi, lo) = util:: split ( value) ;
49- self . map . entry ( hi) . or_insert_with ( RoaringBitmap :: new ) . insert ( lo)
49+ self . map . entry ( hi) . or_default ( ) . insert ( lo)
5050 }
5151
5252 /// Inserts a range of values.
@@ -81,11 +81,11 @@ impl RoaringTreemap {
8181
8282 // Calculate the sub-range from the lower 32 bits
8383 counter += if hi == end_hi && hi == start_hi {
84- entry. or_insert_with ( RoaringBitmap :: new ) . insert_range ( start_lo..=end_lo)
84+ entry. or_default ( ) . insert_range ( start_lo..=end_lo)
8585 } else if hi == start_hi {
86- entry. or_insert_with ( RoaringBitmap :: new ) . insert_range ( start_lo..=u32:: MAX )
86+ entry. or_default ( ) . insert_range ( start_lo..=u32:: MAX )
8787 } else if hi == end_hi {
88- entry. or_insert_with ( RoaringBitmap :: new ) . insert_range ( 0 ..=end_lo)
88+ entry. or_default ( ) . insert_range ( 0 ..=end_lo)
8989 } else {
9090 // We insert a full bitmap if it doesn't already exist and return the size of it.
9191 // But if the bitmap already exists at this spot we replace it with a full bitmap
@@ -122,7 +122,7 @@ impl RoaringTreemap {
122122 /// ```
123123 pub fn push ( & mut self , value : u64 ) -> bool {
124124 let ( hi, lo) = util:: split ( value) ;
125- self . map . entry ( hi) . or_insert_with ( RoaringBitmap :: new ) . push ( lo)
125+ self . map . entry ( hi) . or_default ( ) . push ( lo)
126126 }
127127
128128 /// Pushes `value` in the treemap only if it is greater than the current maximum value.
0 commit comments