This is an archive of the discontinued Mercurial Phabricator instance.

rust-discovery: core implementation for take_quick_sample()
ClosedPublic

Authored by gracinet on May 22 2019, 12:49 PM.

Details

Summary

This makes in particular rand no longer a testing dependency.

We keep a seedable random generator on the PartialDiscovery object
itself, to avoid lengthy initialization.

In take_quick_sample() itself, we had to avoid keeping the reference
to self.undecided to cope with the mutable reference introduced
by the the call to limit_sample, but it's still manageable without
resorting to inner mutability.

Sampling being prone to be improved in the mid-term future, testing
is minimal, amounting to checking which code path got executed.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gracinet created this revision.May 22 2019, 12:49 PM

@kevincox this used to be D6257 (I don't think I changed anything besides rebasing)

kevincox accepted this revision.May 23 2019, 10:47 AM
Alphare updated this revision to Diff 15933.Jul 17 2019, 12:30 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.