diff options
author | Lee Clagett <code@leeclagett.com> | 2021-01-24 07:42:57 +0000 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2021-01-23 06:23:39 +0000 |
commit | 08e4497c6e3b3f434c0bb255c3942648f153fe66 (patch) | |
tree | 2564f4214e9e66b2dc03ce3c788bb080b963be56 /src/serialization/variant.h | |
parent | Merge pull request #7669 (diff) | |
download | monero-08e4497c6e3b3f434c0bb255c3942648f153fe66.tar.xz |
Improve cryptonote (block and tx) binary read performance
Diffstat (limited to 'src/serialization/variant.h')
-rw-r--r-- | src/serialization/variant.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/serialization/variant.h b/src/serialization/variant.h index b08cf6bf0..6debb63d1 100644 --- a/src/serialization/variant.h +++ b/src/serialization/variant.h @@ -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(); |