@@ -223,7 +223,7 @@ impl BitAnd<&RoaringBitmap> for &RoaringBitmap {
223223 for pair in Pairs :: new ( & self . containers , & rhs. containers ) {
224224 if let ( Some ( lhs) , Some ( rhs) ) = pair {
225225 let container = BitAnd :: bitand ( lhs, rhs) ;
226- if container. len ( ) != 0 {
226+ if ! container. is_empty ( ) {
227227 containers. push ( container) ;
228228 }
229229 }
@@ -248,7 +248,7 @@ impl BitAndAssign<RoaringBitmap> for RoaringBitmap {
248248 let rhs_cont = & mut rhs. containers [ loc] ;
249249 let rhs_cont = mem:: replace ( rhs_cont, Container :: new ( rhs_cont. key ) ) ;
250250 BitAndAssign :: bitand_assign ( cont, rhs_cont) ;
251- cont. len ( ) != 0
251+ ! cont. is_empty ( )
252252 }
253253 Err ( _) => false ,
254254 }
@@ -264,7 +264,7 @@ impl BitAndAssign<&RoaringBitmap> for RoaringBitmap {
264264 match rhs. containers . binary_search_by_key ( & key, |c| c. key ) {
265265 Ok ( loc) => {
266266 BitAndAssign :: bitand_assign ( cont, & rhs. containers [ loc] ) ;
267- cont. len ( ) != 0
267+ ! cont. is_empty ( )
268268 }
269269 Err ( _) => false ,
270270 }
@@ -314,7 +314,7 @@ impl Sub<&RoaringBitmap> for &RoaringBitmap {
314314 ( None , Some ( _) ) => ( ) ,
315315 ( Some ( lhs) , Some ( rhs) ) => {
316316 let container = Sub :: sub ( lhs, rhs) ;
317- if container. len ( ) != 0 {
317+ if ! container. is_empty ( ) {
318318 containers. push ( container) ;
319319 }
320320 }
@@ -340,7 +340,7 @@ impl SubAssign<&RoaringBitmap> for RoaringBitmap {
340340 match rhs. containers . binary_search_by_key ( & cont. key , |c| c. key ) {
341341 Ok ( loc) => {
342342 SubAssign :: sub_assign ( cont, & rhs. containers [ loc] ) ;
343- cont. len ( ) != 0
343+ ! cont. is_empty ( )
344344 }
345345 Err ( _) => true ,
346346 }
@@ -390,7 +390,7 @@ impl BitXor<&RoaringBitmap> for &RoaringBitmap {
390390 ( None , Some ( rhs) ) => containers. push ( rhs. clone ( ) ) ,
391391 ( Some ( lhs) , Some ( rhs) ) => {
392392 let container = BitXor :: bitxor ( lhs, rhs) ;
393- if container. len ( ) != 0 {
393+ if ! container. is_empty ( ) {
394394 containers. push ( container) ;
395395 }
396396 }
@@ -409,7 +409,7 @@ impl BitXorAssign<RoaringBitmap> for RoaringBitmap {
409409 match pair {
410410 ( Some ( mut lhs) , Some ( rhs) ) => {
411411 BitXorAssign :: bitxor_assign ( & mut lhs, rhs) ;
412- if lhs. len ( ) != 0 {
412+ if ! lhs. is_empty ( ) {
413413 self . containers . push ( lhs) ;
414414 }
415415 }
@@ -428,7 +428,7 @@ impl BitXorAssign<&RoaringBitmap> for RoaringBitmap {
428428 match pair {
429429 ( Some ( mut lhs) , Some ( rhs) ) => {
430430 BitXorAssign :: bitxor_assign ( & mut lhs, rhs) ;
431- if lhs. len ( ) != 0 {
431+ if ! lhs. is_empty ( ) {
432432 self . containers . push ( lhs) ;
433433 }
434434 }
0 commit comments