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

index: remove position-based methods

This commit is contained in:
Martin von Zweigbergk 2023-03-22 22:02:25 -07:00 committed by Martin von Zweigbergk
parent d4e1156957
commit 0b506d8461
2 changed files with 1 additions and 21 deletions

View file

@ -692,10 +692,6 @@ impl Index for MutableIndexImpl {
self
}
fn commit_id_to_pos(&self, commit_id: &CommitId) -> Option<IndexPosition> {
CompositeIndex(self).commit_id_to_pos(commit_id)
}
fn shortest_unique_commit_id_prefix_len(&self, commit_id: &CommitId) -> usize {
CompositeIndex(self).shortest_unique_commit_id_prefix_len(commit_id)
}
@ -708,10 +704,6 @@ impl Index for MutableIndexImpl {
CompositeIndex(self).entry_by_id(commit_id)
}
fn entry_by_pos(&self, pos: IndexPosition) -> IndexEntry {
CompositeIndex(self).entry_by_pos(pos)
}
fn has_id(&self, commit_id: &CommitId) -> bool {
CompositeIndex(self).has_id(commit_id)
}
@ -1773,10 +1765,6 @@ impl Index for ReadonlyIndexImpl {
self
}
fn commit_id_to_pos(&self, commit_id: &CommitId) -> Option<IndexPosition> {
CompositeIndex(self).commit_id_to_pos(commit_id)
}
fn shortest_unique_commit_id_prefix_len(&self, commit_id: &CommitId) -> usize {
CompositeIndex(self).shortest_unique_commit_id_prefix_len(commit_id)
}
@ -1789,10 +1777,6 @@ impl Index for ReadonlyIndexImpl {
CompositeIndex(self).entry_by_id(commit_id)
}
fn entry_by_pos(&self, pos: IndexPosition) -> IndexEntry {
CompositeIndex(self).entry_by_pos(pos)
}
fn has_id(&self, commit_id: &CommitId) -> bool {
CompositeIndex(self).has_id(commit_id)
}

View file

@ -20,7 +20,7 @@ use thiserror::Error;
use crate::backend::{CommitId, ObjectId};
use crate::commit::Commit;
use crate::default_index_store::{IndexEntry, IndexPosition, RevWalk};
use crate::default_index_store::{IndexEntry, RevWalk};
use crate::op_store::OperationId;
use crate::operation::Operation;
use crate::repo::Repo;
@ -50,16 +50,12 @@ pub trait IndexStore: Send + Sync + Debug {
pub trait Index: Send + Sync {
fn as_any(&self) -> &dyn Any;
fn commit_id_to_pos(&self, commit_id: &CommitId) -> Option<IndexPosition>;
fn shortest_unique_commit_id_prefix_len(&self, commit_id: &CommitId) -> usize;
fn resolve_prefix(&self, prefix: &HexPrefix) -> PrefixResolution<CommitId>;
fn entry_by_id(&self, commit_id: &CommitId) -> Option<IndexEntry>;
fn entry_by_pos(&self, pos: IndexPosition) -> IndexEntry;
fn has_id(&self, commit_id: &CommitId) -> bool;
fn is_ancestor(&self, ancestor_id: &CommitId, descendant_id: &CommitId) -> bool;