File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -705,15 +705,8 @@ impl PendingNewCids {
705705 /// Inserts an issued CID into the queue.
706706 pub ( super ) fn push ( & mut self , cid : IssuedCid ) {
707707 self . 0 . push ( cid) ;
708- self . 0 . sort_by ( |a, b| match a. path_id . cmp ( & b. path_id ) {
709- cmp:: Ordering :: Less => cmp:: Ordering :: Greater ,
710- cmp:: Ordering :: Equal => match a. sequence . cmp ( & b. sequence ) {
711- cmp:: Ordering :: Less => cmp:: Ordering :: Greater ,
712- cmp:: Ordering :: Equal => cmp:: Ordering :: Equal ,
713- cmp:: Ordering :: Greater => cmp:: Ordering :: Less ,
714- } ,
715- cmp:: Ordering :: Greater => cmp:: Ordering :: Less ,
716- } ) ;
708+ self . 0
709+ . sort_by_key ( |cid| cmp:: Reverse ( ( cid. path_id , cid. sequence ) ) ) ;
717710 }
718711
719712 /// Pops the next issued CID to transmit from the queue.
You can’t perform that action at this time.
0 commit comments