D7722: rust-discovery: simplifying add_missing_revisions()

2020-04-22 Thread baymax (Baymax, Your Personal Patch-care Companion)
Herald added a subscriber: mercurial-patches.
This revision now requires changes to proceed.
baymax added a comment.
baymax requested changes to this revision.


  There seems to have been no activities on this Diff for the past 3 Months.
  
  By policy, we are automatically moving it out of the `need-review` state.
  
  Please, move it back to `need-review` without hesitation if this diff should 
still be discussed.
  
  :baymax:need-review-idle:

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7722/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7722

To: gracinet, #hg-reviewers, Alphare, baymax
Cc: mercurial-patches, durin42, kevincox, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7722: rust-discovery: simplifying add_missing_revisions()

2019-12-24 Thread gracinet (Georges Racinet)
gracinet created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  with the removal of the various ensure() it's become
  clear that this doesn't have error cases any more, and we didn't
  need the full match at the end.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7722

AFFECTED FILES
  rust/hg-core/src/discovery.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/discovery.rs b/rust/hg-core/src/discovery.rs
--- a/rust/hg-core/src/discovery.rs
+++ b/rust/hg-core/src/discovery.rs
@@ -266,7 +266,7 @@
 
 self.mutate_undecided(
 |oc| oc.compute_undecided(),
-|wu| wu.add_missing_revisions(missing),
+|wu| Ok(wu.add_missing_revisions(missing)),
 )
 }
 
@@ -456,10 +456,7 @@
 /// caller from `PartialDiscovery` can avoid the undecided set in case
 /// it turns out to be empty (hence restrain
 /// from performing the transition to `WithUndecided`)
-pub fn add_missing_revisions(
-&mut self,
-mut tovisit: VecDeque,
-) -> Result<(), GraphError> {
+pub fn add_missing_revisions(&mut self, mut tovisit: VecDeque) {
 let mut seen: HashSet = HashSet::new();
 let undecided_mut = &mut self.undecided;
 let children = &self.children_cache;
@@ -473,20 +470,14 @@
 continue;
 }
 undecided_mut.remove(&rev);
-match children.get(&rev) {
-None => {
-continue;
-}
-Some(this_children) => {
-for child in this_children.iter().cloned() {
-if seen.insert(child) {
-tovisit.push_back(child);
-}
+if let Some(this_children) = children.get(&rev) {
+for child in this_children.iter().cloned() {
+if seen.insert(child) {
+tovisit.push_back(child);
 }
 }
 }
 }
-Ok(())
 }
 
 fn compute_children_cache(



To: gracinet, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel