mirror of
https://github.com/monero-project/monero.git
synced 2025-08-17 14:30:22 -04:00
Improve cryptonote (block and tx) binary read performance
This commit is contained in:
parent
0a1ddc2eff
commit
08e4497c6e
29 changed files with 229 additions and 230 deletions
|
@ -69,19 +69,19 @@ inline bool do_serialize(Archive<false>& ar, std::pair<F,S>& p)
|
|||
{
|
||||
size_t cnt;
|
||||
ar.begin_array(cnt);
|
||||
if (!ar.stream().good())
|
||||
if (!ar.good())
|
||||
return false;
|
||||
if (cnt != 2)
|
||||
return false;
|
||||
|
||||
if (!::serialization::detail::serialize_pair_element(ar, p.first))
|
||||
return false;
|
||||
if (!ar.stream().good())
|
||||
if (!ar.good())
|
||||
return false;
|
||||
ar.delimit_array();
|
||||
if (!::serialization::detail::serialize_pair_element(ar, p.second))
|
||||
return false;
|
||||
if (!ar.stream().good())
|
||||
if (!ar.good())
|
||||
return false;
|
||||
|
||||
ar.end_array();
|
||||
|
@ -92,16 +92,16 @@ template <template <bool> class Archive, class F, class S>
|
|||
inline bool do_serialize(Archive<true>& ar, std::pair<F,S>& p)
|
||||
{
|
||||
ar.begin_array(2);
|
||||
if (!ar.stream().good())
|
||||
if (!ar.good())
|
||||
return false;
|
||||
if(!::serialization::detail::serialize_pair_element(ar, p.first))
|
||||
return false;
|
||||
if (!ar.stream().good())
|
||||
if (!ar.good())
|
||||
return false;
|
||||
ar.delimit_array();
|
||||
if(!::serialization::detail::serialize_pair_element(ar, p.second))
|
||||
return false;
|
||||
if (!ar.stream().good())
|
||||
if (!ar.good())
|
||||
return false;
|
||||
ar.end_array();
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue