D7718: rust-directory: simplify bidirectional sampling

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/D7718/new/

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

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


D7718: rust-directory: simplify bidirectional sampling

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
  Thanks to the typestate pattern, we don't have a
  complicated management of borrows to perform in
  that method with the early return condition and
  the comment was just obsolete.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -563,13 +563,8 @@
 &mut self,
 size: usize,
 ) -> Result<(HashSet, usize), GraphError> {
-{
-// we don't want to compute children_cache before this
-// but doing it after extracting self.undecided takes a mutable
-// ref to self while a shareable one is still active.
-if self.undecided.len() <= size {
-return Ok((self.undecided.clone(), size));
-}
+if self.undecided.len() <= size {
+return Ok((self.undecided.clone(), size));
 }
 
 self.ensure_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