mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Optimize and clean up SHAMap::iterator:
* Remove dependence on boost::iterator_facade. * Rename iterator to const_iterator. * Change value_type from shared_ptr<SHAMapItem const> to SHAMapItem. * Install a stack-path to the current SHAMapItem in the const_iterator.
This commit is contained in:
committed by
Vinnie Falco
parent
30e068ae17
commit
361f1da5b8
@@ -59,7 +59,7 @@ class Ledger::txs_iter_impl
|
||||
private:
|
||||
bool metadata_;
|
||||
ReadView const* view_;
|
||||
SHAMap::iterator iter_;
|
||||
SHAMap::const_iterator iter_;
|
||||
|
||||
public:
|
||||
txs_iter_impl() = delete;
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
txs_iter_impl (txs_iter_impl const&) = default;
|
||||
|
||||
txs_iter_impl (bool metadata,
|
||||
SHAMap::iterator iter,
|
||||
SHAMap::const_iterator iter,
|
||||
ReadView const& view)
|
||||
: metadata_ (metadata)
|
||||
, view_ (&view)
|
||||
@@ -102,8 +102,8 @@ public:
|
||||
{
|
||||
auto const item = *iter_;
|
||||
if (metadata_)
|
||||
return deserializeTxPlusMeta(*item);
|
||||
return { deserializeTx(*item), nullptr };
|
||||
return deserializeTxPlusMeta(item);
|
||||
return { deserializeTx(item), nullptr };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user