Show More
@@ -336,17 +336,15 b' impl<G: Graph> MissingAncestors<G> {' | |||
|
336 | 336 | bases_visit.insert(p); |
|
337 | 337 | both_visit.insert(p); |
|
338 | 338 | } |
|
339 | continue; | |
|
340 | } | |
|
341 | if revs_visit.remove(&curr) { | |
|
339 | } else if revs_visit.remove(&curr) { | |
|
342 | 340 | missing.push(curr); |
|
343 | 341 | for p in self.graph.parents(curr)?.iter().cloned() { |
|
344 | 342 | if p == NULL_REVISION { |
|
345 | 343 | continue; |
|
346 | 344 | } |
|
347 | 345 | if bases_visit.contains(&p) || both_visit.contains(&p) { |
|
348 |
// p is |
|
|
349 |
// |
|
|
346 | // p is an ancestor of revs_visit, and is implicitly | |
|
347 | // in bases_visit, which means p is ::revs & ::bases. | |
|
350 | 348 | // TODO optim: hence if bothvisit, we look up twice |
|
351 | 349 | revs_visit.remove(&p); |
|
352 | 350 | bases_visit.insert(p); |
@@ -362,19 +360,16 b' impl<G: Graph> MissingAncestors<G> {' | |||
|
362 | 360 | continue; |
|
363 | 361 | } |
|
364 | 362 | if revs_visit.contains(&p) || both_visit.contains(&p) { |
|
365 |
// p is |
|
|
366 |
// |
|
|
363 | // p is an ancestor of bases_visit, and is implicitly | |
|
364 | // in revs_visit, which means p is ::revs & ::bases. | |
|
367 | 365 | // TODO optim: hence if bothvisit, we look up twice |
|
368 | 366 | revs_visit.remove(&p); |
|
369 | 367 | bases_visit.insert(p); |
|
370 | 368 | both_visit.insert(p); |
|
371 | 369 | } else { |
|
372 | // visit later | |
|
373 | 370 | bases_visit.insert(p); |
|
374 | 371 | } |
|
375 | 372 | } |
|
376 | } else { | |
|
377 | // not an ancestor of revs or bases: ignore | |
|
378 | 373 | } |
|
379 | 374 | } |
|
380 | 375 | missing.reverse(); |
General Comments 0
You need to be logged in to leave comments.
Login now