This PR modernizes FuzzedDataProvider.h by resolving outstanding C++17 migration TODOs.
-
Replace conditional with
if constexprinConvertUnsignedToSigned- The TODO noted this should be changed once C++17 becomes mainstream
-
Fix signed/unsigned comparison
- Add explicit cast in comparison to avoid implicit conversions
- Makes the type conversion explicit and safer
-
Remove outdated TODO in
PickValueInArray- The TODO suggested using
static_assert, but this is not possible sincestd::initializer_list::size()is a runtime value when passed as a function parameter
- The TODO suggested using
Motivation:
These TODOs have been present since the code was written, waiting for C++14/C++17 adoption. Since Bitcoin Core now uses C++20, these modernizations are long overdue.