Add ReadView::sles

This commit is contained in:
Vinnie Falco
2015-07-14 11:56:09 -07:00
parent 110bbf3956
commit 84161b86c7
17 changed files with 273 additions and 80 deletions

View File

@@ -169,18 +169,6 @@ getCandidateLedger (LedgerIndex requested)
return (requested + 255) & (~255);
}
/** Run a functor on each SLE in a ReadView starting from the key start,
as long as the functor returns true.
*/
template <class Functor>
void forEachSLE(ReadView const& view, Functor func, uint256 const& start = {})
{
for (auto k = view.succ(start); k; k = view.succ(*k))
if (auto sle = view.read(keylet::unchecked(*k)))
if (! func(*sle))
break;
}
//------------------------------------------------------------------------------
//
// Modifiers