This is an archive of the discontinued Mercurial Phabricator instance.

rust-discovery: core implementation for take_quick_sample()
AbandonedPublic

Authored by gracinet on Jun 12 2019, 2:16 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
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
Lint Skipped
Unit
Unit Tests Skipped