mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Eliminate redundant traversal logic of SHAMap:
* Only the const_iterator interface remains.
This commit is contained in:
committed by
Nik Bougalis
parent
96c13f0d98
commit
12e11721f9
@@ -894,9 +894,8 @@ boost::optional<uint256>
|
||||
Ledger::succ (uint256 const& key,
|
||||
boost::optional<uint256> last) const
|
||||
{
|
||||
auto const item =
|
||||
stateMap_->peekNextItem(key);
|
||||
if (! item)
|
||||
auto item = stateMap_->upper_bound(key);
|
||||
if (item == stateMap_->end())
|
||||
return boost::none;
|
||||
if (last && item->key() >= last)
|
||||
return boost::none;
|
||||
@@ -1148,16 +1147,6 @@ void Ledger::visitStateItems (std::function<void (SLE::ref)> callback) const
|
||||
}
|
||||
}
|
||||
|
||||
uint256 Ledger::getNextLedgerIndex (uint256 const& hash,
|
||||
boost::optional<uint256> const& last) const
|
||||
{
|
||||
auto const node =
|
||||
stateMap_->peekNextItem(hash);
|
||||
if ((! node) || (last && node->key() >= *last))
|
||||
return {};
|
||||
return node->key();
|
||||
}
|
||||
|
||||
bool Ledger::walkLedger () const
|
||||
{
|
||||
std::vector <SHAMapMissingNode> missingNodes1;
|
||||
|
||||
Reference in New Issue
Block a user