Skip to content

Commit

Permalink
#1702 changed [] to at() for safe vector access
Browse files Browse the repository at this point in the history
  • Loading branch information
kladkogex committed Nov 6, 2023
1 parent ee9c48a commit aa4c0d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libethereum/ChainParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ ChainParams ChainParams::loadConfig(
auto groupNodesObj = nodeGroupObj["nodes"].get_obj();
for ( const auto& groupNodeConf : groupNodesObj ) {
auto groupNodeConfObj = groupNodeConf.second.get_array();
u256 sChainIndex = groupNodeConfObj[0].get_uint64();
u256 id = groupNodeConfObj[1].get_uint64();
std::string publicKey = groupNodeConfObj[2].get_str();
std::string address = groupNodeConfObj[3].get_str();
u256 sChainIndex = groupNodeConfObj.at(0).get_uint64();
u256 id = groupNodeConfObj.at(1).get_uint64();
std::string publicKey = groupNodeConfObj.at(2).get_str();
std::string address = groupNodeConfObj.at(3).get_str();
groupNodes.push_back( { id, sChainIndex, publicKey, address } );
}
std::sort( groupNodes.begin(), groupNodes.end(),
Expand Down

0 comments on commit aa4c0d8

Please sign in to comment.