diff --git a/Ledger.cpp b/Ledger.cpp index 4ce9e8239..90237b022 100644 --- a/Ledger.cpp +++ b/Ledger.cpp @@ -478,9 +478,7 @@ Ledger::pointer Ledger::switchPreviousLedger(Ledger::pointer oldPrevious, Ledger if(!tx || newLedger->addTransaction(tx)) { count++; - std::map >::iterator it2=it; - ++it; - TxnDiff.erase(it2); + TxnDiff.erase(it++); } else ++it; } @@ -509,9 +507,7 @@ Ledger::pointer Ledger::switchPreviousLedger(Ledger::pointer oldPrevious, Ledger if(newLedger->addTransaction(it->second)) { count++; - std::map::iterator it2=it; - ++it; - txnMap.erase(it2); + txnMap.erase(it++); } else ++it; }