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:
seelabs
2019-08-06 09:11:32 -07:00
parent 9c58f23cf8
commit 7912ee6f7b
66 changed files with 428 additions and 466 deletions

View File

@@ -1691,13 +1691,8 @@ ApplicationImp::getLastFullLedger()
try
{
std::shared_ptr<Ledger> ledger;
std::uint32_t seq;
uint256 hash;
std::tie (ledger, seq, hash) =
loadLedgerHelper (
"order by LedgerSeq desc limit 1", *this);
auto const [ledger, seq, hash] =
loadLedgerHelper("order by LedgerSeq desc limit 1", *this);
if (!ledger)
return ledger;
@@ -1998,9 +1993,9 @@ bool ApplicationImp::loadOldLedger (
auto replayData =
std::make_unique<LedgerReplay>(loadLedger, replayLedger);
for (auto const& it : replayData->orderedTxns())
for (auto const& [_, tx] : replayData->orderedTxns())
{
std::shared_ptr<STTx const> const& tx = it.second;
(void)_;
auto txID = tx->getTransactionID();
auto s = std::make_shared <Serializer> ();