refactor: replace sizeof(a)/sizeof(a[0]) by std::size (C++17)

Removes the macro ARRAYLEN and also substitutes all other uses of the same
"sizeof(a)/sizeof(a[0])" pattern by std::size, available since C++17.
This commit is contained in:
Sebastian Falbesoner
2020-11-20 00:14:32 +01:00
parent 365539c846
commit e829c9afbf
9 changed files with 12 additions and 15 deletions

View File

@@ -88,7 +88,7 @@ void static RandomScript(CScript &script) {
script = CScript();
int ops = (InsecureRandRange(10));
for (int i=0; i<ops; i++)
script << oplist[InsecureRandRange(sizeof(oplist)/sizeof(oplist[0]))];
script << oplist[InsecureRandRange(std::size(oplist))];
}
void static RandomTransaction(CMutableTransaction &tx, bool fSingle) {