mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-12 07:14:38 +00:00
dag_walk: do one less clone() in heads_ok()
This commit is contained in:
parent
dddba4675d
commit
60b35f676e
1 changed files with 1 additions and 2 deletions
|
@ -486,8 +486,7 @@ where
|
|||
II: IntoIterator<Item = Result<T, E>>,
|
||||
NI: IntoIterator<Item = Result<T, E>>,
|
||||
{
|
||||
let start: Vec<T> = start.into_iter().try_collect()?;
|
||||
let mut heads: HashSet<T> = start.iter().cloned().collect();
|
||||
let mut heads: HashSet<T> = start.into_iter().try_collect()?;
|
||||
// Do a BFS until we have only one item left in the frontier. That frontier must
|
||||
// have originated from one of the heads, and since there can't be cycles,
|
||||
// it won't be able to eliminate any other heads.
|
||||
|
|
Loading…
Reference in a new issue