File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -612,7 +612,7 @@ where
612612 ///
613613 /// Computes in **O(log(N))** time.
614614 pub fn push_increase ( & mut self , item : I , priority : P ) -> Option < P > {
615- if self . get_priority ( & item) . is_none_or ( |p| priority > * p) {
615+ if self . get_priority ( & item) . map_or ( true , |p| priority > * p) {
616616 self . push ( item, priority)
617617 } else {
618618 Some ( priority)
@@ -650,7 +650,7 @@ where
650650 ///
651651 /// Computes in **O(log(N))** time.
652652 pub fn push_decrease ( & mut self , item : I , priority : P ) -> Option < P > {
653- if self . get_priority ( & item) . is_none_or ( |p| priority < * p) {
653+ if self . get_priority ( & item) . map_or ( true , |p| priority < * p) {
654654 self . push ( item, priority)
655655 } else {
656656 Some ( priority)
Original file line number Diff line number Diff line change @@ -486,7 +486,7 @@ where
486486 ///
487487 /// Computes in **O(log(N))** time.
488488 pub fn push_increase ( & mut self , item : I , priority : P ) -> Option < P > {
489- if self . get_priority ( & item) . is_none_or ( |p| priority > * p) {
489+ if self . get_priority ( & item) . map_or ( true , |p| priority > * p) {
490490 self . push ( item, priority)
491491 } else {
492492 Some ( priority)
@@ -524,7 +524,7 @@ where
524524 ///
525525 /// Computes in **O(log(N))** time.
526526 pub fn push_decrease ( & mut self , item : I , priority : P ) -> Option < P > {
527- if self . get_priority ( & item) . is_none_or ( |p| priority < * p) {
527+ if self . get_priority ( & item) . map_or ( true , |p| priority < * p) {
528528 self . push ( item, priority)
529529 } else {
530530 Some ( priority)
Original file line number Diff line number Diff line change @@ -330,8 +330,8 @@ where
330330 self . map . retain2 ( predicate) ;
331331 if self . map . len ( ) != self . size {
332332 self . size = self . map . len ( ) ;
333- self . heap = ( 0 ..self . size ) . into_iter ( ) . map ( |i| Index ( i ) ) . collect ( ) ;
334- self . qp = ( 0 ..self . size ) . into_iter ( ) . map ( |p| Position ( p ) ) . collect ( ) ;
333+ self . heap = ( 0 ..self . size ) . map ( Index ) . collect ( ) ;
334+ self . qp = ( 0 ..self . size ) . map ( Position ) . collect ( ) ;
335335 }
336336 }
337337
You can’t perform that action at this time.
0 commit comments