equal
deleted
inserted
replaced
63 { |
63 { |
64 let mut distances: HashMap<Revision, u32> = HashMap::new(); |
64 let mut distances: HashMap<Revision, u32> = HashMap::new(); |
65 let mut visit: VecDeque<Revision> = heads.into_iter().collect(); |
65 let mut visit: VecDeque<Revision> = heads.into_iter().collect(); |
66 let mut factor: u32 = 1; |
66 let mut factor: u32 = 1; |
67 let mut seen: HashSet<Revision> = HashSet::new(); |
67 let mut seen: HashSet<Revision> = HashSet::new(); |
68 loop { |
68 while let Some(current) = visit.pop_front() { |
69 let current = match visit.pop_front() { |
|
70 None => { |
|
71 break; |
|
72 } |
|
73 Some(r) => r, |
|
74 }; |
|
75 if !seen.insert(current) { |
69 if !seen.insert(current) { |
76 continue; |
70 continue; |
77 } |
71 } |
78 |
72 |
79 let d = *distances.entry(current).or_insert(1); |
73 let d = *distances.entry(current).or_insert(1); |