D6257: rust-discovery: core implementation for take_quick_sample()

gracinet (Georges Racinet) phabricator at mercurial-scm.org
Mon May 6 11:32:57 EDT 2019

gracinet added a comment.

  @kevincox thanks for the initial review, I think I've implemented the corrections you suggested.


> kevincox wrote in discovery.rs:70
> You can do
>   if see.insert(current).is_some() {
>     continue; // Already present.
>   }
> And avoid the insert below. Alternatively use the entry API which may be a bit more readable.

Ah yes that's right, let this one through.

Since `seen` is not used in the loop after that check (there's an early return that doesn't matter in this case), I found the boolean return of `HashSet::insert()` does the job neatly.

  rHG Mercurial


To: gracinet, #hg-reviewers, kevincox
Cc: durin42, kevincox, mercurial-devel

More information about the Mercurial-devel mailing list