mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-02 18:01:05 +00:00
revset: replace an unnecessary iterator adapter by a simple map()
As noted by @yuja in #1423.
This commit is contained in:
parent
5b2e1cbe07
commit
772cb1a0e9
1 changed files with 1 additions and 11 deletions
|
@ -74,7 +74,7 @@ impl<'index> RevsetImpl<'index> {
|
|||
|
||||
impl<'index> Revset<'index> for RevsetImpl<'index> {
|
||||
fn iter(&self) -> Box<dyn Iterator<Item = CommitId> + '_> {
|
||||
Box::new(RevsetCommitIdIterator(self.inner.iter()))
|
||||
Box::new(self.inner.iter().map(|index_entry| index_entry.commit_id()))
|
||||
}
|
||||
|
||||
fn iter_graph(&self) -> Box<dyn Iterator<Item = (CommitId, Vec<RevsetGraphEdge>)> + '_> {
|
||||
|
@ -99,16 +99,6 @@ impl<'index> Revset<'index> for RevsetImpl<'index> {
|
|||
}
|
||||
}
|
||||
|
||||
struct RevsetCommitIdIterator<I>(I);
|
||||
|
||||
impl<'index, I: Iterator<Item = IndexEntry<'index>>> Iterator for RevsetCommitIdIterator<I> {
|
||||
type Item = CommitId;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.0.next().map(|index_entry| index_entry.commit_id())
|
||||
}
|
||||
}
|
||||
|
||||
struct ChangeIdIndexImpl<'index> {
|
||||
index: CompositeIndex<'index>,
|
||||
pos_by_change: IdIndex<ChangeId, IndexPosition>,
|
||||
|
|
Loading…
Reference in a new issue