Skip to content

Conversation

PastaPastaPasta
Copy link
Contributor

@PastaPastaPasta PastaPastaPasta commented Apr 19, 2022

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>()

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 20, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #24974 (refactor: Make FEELER_SLEEP_WINDOW type safe (std::chrono) by MarcoFalke)
  • #24185 (refactor: only use explicit reinterpret/const casts, not implicit by PastaPastaPasta)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@laanwj laanwj changed the title refactor: make GetRand a template, remove GetRandInt by PastaPastaPasta refactor: make GetRand a template, remove GetRandInt Apr 21, 2022
@fanquake
Copy link
Member

fanquake commented May 6, 2022

@laanwj you might be interested in taking a look here?

@laanwj
Copy link
Member

laanwj commented May 11, 2022

Code review ACK ab1ea29
I like how this gets rid of a lot of reinterpret_casts (punning integers as bytes).

@maflcko maflcko merged commit a2a8e91 into bitcoin:master May 12, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 13, 2022
@bitcoin bitcoin locked and limited conversation to collaborators May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants