mirror of
https://github.com/monero-project/monero.git
synced 2025-08-11 02:30:11 -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
|
@ -74,7 +74,7 @@ struct variant_reader
|
|||
current_type x;
|
||||
if(!::do_serialize(ar, x))
|
||||
{
|
||||
ar.stream().setstate(std::ios::failbit);
|
||||
ar.set_fail();
|
||||
return false;
|
||||
}
|
||||
v = x;
|
||||
|
@ -95,7 +95,7 @@ struct variant_reader<Archive, Variant, TBegin, TBegin>
|
|||
|
||||
static inline bool read(Archive &ar, Variant &v, variant_tag_type t)
|
||||
{
|
||||
ar.stream().setstate(std::ios::failbit);
|
||||
ar.set_fail();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -116,7 +116,7 @@ struct serializer<Archive<false>, boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>>
|
|||
typename boost::mpl::begin<types>::type,
|
||||
typename boost::mpl::end<types>::type>::read(ar, v, t))
|
||||
{
|
||||
ar.stream().setstate(std::ios::failbit);
|
||||
ar.set_fail();
|
||||
return false;
|
||||
}
|
||||
ar.end_variant();
|
||||
|
@ -143,7 +143,7 @@ struct serializer<Archive<true>, boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>>
|
|||
ar.write_variant_tag(variant_serialization_traits<Archive<true>, T>::get_tag());
|
||||
if(!::do_serialize(ar, rv))
|
||||
{
|
||||
ar.stream().setstate(std::ios::failbit);
|
||||
ar.set_fail();
|
||||
return false;
|
||||
}
|
||||
ar.end_variant();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue