mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use structured bindings in some places:
Most of the new uses either: * Replace some uses of `tie` * bind to pairs when iterating through maps
This commit is contained in:
@@ -226,10 +226,10 @@ public:
|
||||
saveDot(std::ostream & out, VertexName&& vertexName) const
|
||||
{
|
||||
out << "digraph {\n";
|
||||
for (auto const& vData : graph_)
|
||||
for (auto const& [vertex, links] : graph_)
|
||||
{
|
||||
auto const fromName = vertexName(vData.first);
|
||||
for (auto const& eData : vData.second)
|
||||
auto const fromName = vertexName(vertex);
|
||||
for (auto const& eData : links)
|
||||
{
|
||||
auto const toName = vertexName(eData.first);
|
||||
out << fromName << " -> " << toName << ";\n";
|
||||
|
||||
@@ -91,9 +91,9 @@ public:
|
||||
return tmp;
|
||||
// Since counts are sorted, shouldn't need to worry much about numerical
|
||||
// error
|
||||
for (auto const& it : counts_)
|
||||
for (auto const& [bin, count] : counts_)
|
||||
{
|
||||
tmp += it.first * it.second;
|
||||
tmp += bin * count;
|
||||
}
|
||||
return tmp/samples;
|
||||
}
|
||||
|
||||
@@ -801,11 +801,11 @@ struct Peer
|
||||
bool
|
||||
handle(TxSet const& txs)
|
||||
{
|
||||
auto const it = txSets.insert(std::make_pair(txs.id(), txs));
|
||||
if (it.second)
|
||||
bool const inserted = txSets.insert(std::make_pair(txs.id(), txs)).second;
|
||||
if (inserted)
|
||||
consensus.gotTxSet(now(), txs);
|
||||
// relay only if new
|
||||
return it.second;
|
||||
return inserted;
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user