Show More
@@ -79,8 +79,7 b' impl<G: Graph> AncestorsIterator<G> {' | |||||
79 |
|
79 | |||
80 | #[inline] |
|
80 | #[inline] | |
81 | fn conditionally_push_rev(&mut self, rev: Revision) { |
|
81 | fn conditionally_push_rev(&mut self, rev: Revision) { | |
82 |
if self.stoprev <= rev && |
|
82 | if self.stoprev <= rev && self.seen.insert(rev) { | |
83 | self.seen.insert(rev); |
|
|||
84 | self.visit.push(rev); |
|
83 | self.visit.push(rev); | |
85 | } |
|
84 | } | |
86 | } |
|
85 | } | |
@@ -154,11 +153,10 b' impl<G: Graph> Iterator for AncestorsIte' | |||||
154 | Ok(ps) => ps, |
|
153 | Ok(ps) => ps, | |
155 | Err(e) => return Some(Err(e)), |
|
154 | Err(e) => return Some(Err(e)), | |
156 | }; |
|
155 | }; | |
157 |
if p1 < self.stoprev || self.seen. |
|
156 | if p1 < self.stoprev || !self.seen.insert(p1) { | |
158 | self.visit.pop(); |
|
157 | self.visit.pop(); | |
159 | } else { |
|
158 | } else { | |
160 | *(self.visit.peek_mut().unwrap()) = p1; |
|
159 | *(self.visit.peek_mut().unwrap()) = p1; | |
161 | self.seen.insert(p1); |
|
|||
162 | }; |
|
160 | }; | |
163 |
|
161 | |||
164 | self.conditionally_push_rev(p2); |
|
162 | self.conditionally_push_rev(p2); |
General Comments 0
You need to be logged in to leave comments.
Login now