ok/jj
1
0
Fork 0
forked from mirrors/jj

index: remove topo_order() which is no longer used

The same thing can be achieved by evaluating the input as a revset.
This commit is contained in:
Yuya Nishihara 2024-03-15 17:45:01 +09:00
parent b2194d7d2b
commit a777cfe98e
4 changed files with 0 additions and 18 deletions

View file

@ -483,12 +483,6 @@ impl Index for &CompositeIndex {
.collect()
}
fn topo_order(&self, input: &mut dyn Iterator<Item = &CommitId>) -> Vec<CommitId> {
let mut ids = input.cloned().collect_vec();
ids.sort_by_cached_key(|id| self.commit_id_to_pos(id).unwrap());
ids
}
fn evaluate_revset<'index>(
&'index self,
expression: &ResolvedExpression,

View file

@ -504,10 +504,6 @@ impl Index for DefaultMutableIndex {
self.as_composite().heads(candidates)
}
fn topo_order(&self, input: &mut dyn Iterator<Item = &CommitId>) -> Vec<CommitId> {
self.as_composite().topo_order(input)
}
fn evaluate_revset<'index>(
&'index self,
expression: &ResolvedExpression,

View file

@ -607,10 +607,6 @@ impl Index for DefaultReadonlyIndex {
self.as_composite().heads(candidates)
}
fn topo_order(&self, input: &mut dyn Iterator<Item = &CommitId>) -> Vec<CommitId> {
self.as_composite().topo_order(input)
}
fn evaluate_revset<'index>(
&'index self,
expression: &ResolvedExpression,

View file

@ -116,10 +116,6 @@ pub trait Index: Send + Sync {
/// `candidates` list it will appear at most once in the output.
fn heads(&self, candidates: &mut dyn Iterator<Item = &CommitId>) -> Vec<CommitId>;
/// Orders a list of commit IDs such that parent commits appear before any
/// of their children. Commit IDs in the `input` are not deduplicated.
fn topo_order(&self, input: &mut dyn Iterator<Item = &CommitId>) -> Vec<CommitId>;
/// Resolves the revset `expression` against the index and corresponding
/// `store`.
fn evaluate_revset<'index>(