File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -317,11 +317,11 @@ impl CompositeIndex {
317317 /// The returned index positions are sorted in descending order.
318318 pub ( super ) fn common_ancestors_pos (
319319 & self ,
320- set1 : & [ IndexPosition ] ,
321- set2 : & [ IndexPosition ] ,
320+ set1 : Vec < IndexPosition > ,
321+ set2 : Vec < IndexPosition > ,
322322 ) -> Vec < IndexPosition > {
323- let mut items1: BinaryHeap < _ > = set1 . iter ( ) . copied ( ) . collect ( ) ;
324- let mut items2: BinaryHeap < _ > = set2 . iter ( ) . copied ( ) . collect ( ) ;
323+ let mut items1 = BinaryHeap :: from ( set1 ) ;
324+ let mut items2 = BinaryHeap :: from ( set2 ) ;
325325 let mut result = Vec :: new ( ) ;
326326 while let ( Some ( & pos1) , Some ( & pos2) ) = ( items1. peek ( ) , items2. peek ( ) ) {
327327 match pos1. cmp ( & pos2) {
@@ -467,7 +467,7 @@ impl Index for &CompositeIndex {
467467 . iter ( )
468468 . map ( |id| self . commit_id_to_pos ( id) . unwrap ( ) )
469469 . collect_vec ( ) ;
470- self . common_ancestors_pos ( & pos1, & pos2)
470+ self . common_ancestors_pos ( pos1, pos2)
471471 . iter ( )
472472 . map ( |pos| self . entry_by_pos ( * pos) . commit_id ( ) )
473473 . collect ( )
Original file line number Diff line number Diff line change @@ -964,7 +964,7 @@ impl EvaluationContext<'_> {
964964 } ;
965965 let mut positions = vec ! [ position?] ;
966966 for position in expression_positions_iter {
967- positions = index. common_ancestors_pos ( & positions, & [ position?] ) ;
967+ positions = index. common_ancestors_pos ( positions, vec ! [ position?] ) ;
968968 }
969969 Ok ( Box :: new ( EagerRevset { positions } ) )
970970 }
You can’t perform that action at this time.
0 commit comments