HomePhabricator

refactor: make GetRand a template, remove GetRandInt

Description

refactor: make GetRand a template, remove GetRandInt

Summary:
makes GetRand a template for which any integral type can be used, where the default behavior is to return a random integral up to the max of the integral unless a max is provided.
This simplifies a lot of code from GetRand(std::numeric_limits<uint64_t>::max() -> GetRand<uint64_t>()

This is a backport of core#24925

Depends on D14827

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14828

Details

Provenance
pasta <pasta@dashboost.org>Authored on Jan 31 2022, 12:32
PiRKCommitted on Nov 22 2023, 11:50
PiRKPushed on Nov 22 2023, 11:50
Reviewer
Restricted Project
Differential Revision
D14828: refactor: make GetRand a template, remove GetRandInt
Parents
rABC1281b06a1eee: Bump version to 0.28.4
Branches
Unknown
Tags
Unknown