refactor: init vectors via std::{begin,end} to avoid pointer arithmetic

pull/20429/head
Sebastian Falbesoner 4 years ago
parent 63d4ee1968
commit 365539c846

@ -8,7 +8,7 @@ namespace benchmark {
namespace data { namespace data {
#include <bench/data/block413567.raw.h> #include <bench/data/block413567.raw.h>
const std::vector<uint8_t> block413567{block413567_raw, block413567_raw + sizeof(block413567_raw) / sizeof(block413567_raw[0])}; const std::vector<uint8_t> block413567{std::begin(block413567_raw), std::end(block413567_raw)};
} // namespace data } // namespace data
} // namespace benchmark } // namespace benchmark

@ -10,7 +10,6 @@
#include <hash.h> // for signet block challenge hash #include <hash.h> // for signet block challenge hash
#include <tinyformat.h> #include <tinyformat.h>
#include <util/system.h> #include <util/system.h>
#include <util/strencodings.h>
#include <versionbitsinfo.h> #include <versionbitsinfo.h>
#include <assert.h> #include <assert.h>
@ -136,7 +135,7 @@ public:
bech32_hrp = "bc"; bech32_hrp = "bc";
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); vFixedSeeds = std::vector<SeedSpec6>(std::begin(pnSeed6_main), std::end(pnSeed6_main));
fDefaultConsistencyChecks = false; fDefaultConsistencyChecks = false;
fRequireStandard = true; fRequireStandard = true;
@ -237,7 +236,7 @@ public:
bech32_hrp = "tb"; bech32_hrp = "tb";
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); vFixedSeeds = std::vector<SeedSpec6>(std::begin(pnSeed6_test), std::end(pnSeed6_test));
fDefaultConsistencyChecks = false; fDefaultConsistencyChecks = false;
fRequireStandard = false; fRequireStandard = false;

@ -5,7 +5,6 @@
#include <protocol.h> #include <protocol.h>
#include <util/strencodings.h>
#include <util/system.h> #include <util/system.h>
static std::atomic<bool> g_initial_block_download_completed(false); static std::atomic<bool> g_initial_block_download_completed(false);
@ -86,7 +85,7 @@ const static std::string allNetMessageTypes[] = {
NetMsgType::CFCHECKPT, NetMsgType::CFCHECKPT,
NetMsgType::WTXIDRELAY, NetMsgType::WTXIDRELAY,
}; };
const static std::vector<std::string> allNetMessageTypesVec(allNetMessageTypes, allNetMessageTypes+ARRAYLEN(allNetMessageTypes)); const static std::vector<std::string> allNetMessageTypesVec(std::begin(allNetMessageTypes), std::end(allNetMessageTypes));
CMessageHeader::CMessageHeader() CMessageHeader::CMessageHeader()
{ {

Loading…
Cancel
Save