From d04556cf18196dba1c0ed8e262e5884154ce7115 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 25 Mar 2023 19:20:15 +0900 Subject: [PATCH] revset: use unstable sort to enforce ordering of commit ids This wouldn't matter in practice, but there should be no reason to stick to stable sort. --- lib/src/default_revset_engine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/default_revset_engine.rs b/lib/src/default_revset_engine.rs index 6e3305762..a59ba17a8 100644 --- a/lib/src/default_revset_engine.rs +++ b/lib/src/default_revset_engine.rs @@ -717,7 +717,7 @@ fn revset_for_commit_ids<'index>( for id in commit_ids { index_entries.push(index.entry_by_id(id).unwrap()); } - index_entries.sort_by_key(|b| Reverse(b.position())); + index_entries.sort_unstable_by_key(|b| Reverse(b.position())); index_entries.dedup(); Box::new(EagerRevset { index_entries }) }