This is an archive of the discontinued Mercurial Phabricator instance.

rust-discovery: postponing random generator init
Needs RevisionPublic

Authored by gracinet on Dec 24 2019, 8:50 AM.

Details

Reviewers
Alphare
baymax
Group Reviewers
hg-reviewers
Summary

This is an example of the benefits we get with the
typestape pattern: we can cleanly postpone the
seeding and initialisation of the random generator.

This makes the default() method a bit cheaper. Its point
is that its output is a placeholder not meand to be really used,
but if that happened, it would now be with the knowledge that
the seed hasn't been initialized (and possible seeding after
morphing into a discovery with undecided set)

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

gracinet created this revision.Dec 24 2019, 8:50 AM
Alphare accepted this revision.Jan 3 2020, 4:56 AM
baymax requested changes to this revision.Apr 22 2020, 11:52 AM

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:

This revision now requires changes to proceed.Apr 22 2020, 11:52 AM