mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-28 23:32:41 +00:00
merge: remove Merge::take() which is no longer used
Merge::take() is no longer a cheap function. We can add into_vec() if needed.
This commit is contained in:
parent
92dfe59ade
commit
3fddc31da8
1 changed files with 0 additions and 13 deletions
|
@ -165,19 +165,6 @@ impl<T> Merge<T> {
|
|||
Merge::new(removes, adds)
|
||||
}
|
||||
|
||||
/// Returns the removes and adds as a pair.
|
||||
pub fn take(self) -> (Vec<T>, Vec<T>) {
|
||||
let mut removes = Vec::with_capacity(self.values.len() / 2);
|
||||
let mut adds = Vec::with_capacity(self.values.len() / 2 + 1);
|
||||
let mut values = self.values.into_iter();
|
||||
adds.push(values.next().unwrap());
|
||||
while let Some(remove) = values.next() {
|
||||
removes.push(remove);
|
||||
adds.push(values.next().unwrap());
|
||||
}
|
||||
(removes, adds)
|
||||
}
|
||||
|
||||
/// The removed values, also called negative terms.
|
||||
pub fn removes(&self) -> impl ExactSizeIterator<Item = &T> {
|
||||
self.values[1..].iter().step_by(2)
|
||||
|
|
Loading…
Reference in a new issue