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/container.h | |
parent | Merge pull request #7669 (diff) | |
download | monero-08e4497c6e3b3f434c0bb255c3942648f153fe66.tar.xz |
Improve cryptonote (block and tx) binary read performance
Diffstat (limited to '')
-rw-r--r-- | src/serialization/container.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/serialization/container.h b/src/serialization/container.h index a4997c8ae..77681ec93 100644 --- a/src/serialization/container.h +++ b/src/serialization/container.h @@ -67,13 +67,13 @@ bool do_serialize_container(Archive<false> &ar, C &v) { size_t cnt; ar.begin_array(cnt); - if (!ar.stream().good()) + if (!ar.good()) return false; v.clear(); // very basic sanity check if (ar.remaining_bytes() < cnt) { - ar.stream().setstate(std::ios::failbit); + ar.set_fail(); return false; } @@ -86,7 +86,7 @@ bool do_serialize_container(Archive<false> &ar, C &v) if (!::serialization::detail::serialize_container_element(ar, e)) return false; ::serialization::detail::do_add(v, std::move(e)); - if (!ar.stream().good()) + if (!ar.good()) return false; } ar.end_array(); @@ -100,13 +100,13 @@ bool do_serialize_container(Archive<true> &ar, C &v) ar.begin_array(cnt); for (auto i = v.begin(); i != v.end(); ++i) { - if (!ar.stream().good()) + if (!ar.good()) return false; if (i != v.begin()) ar.delimit_array(); if(!::serialization::detail::serialize_container_element(ar, (typename C::value_type&)*i)) return false; - if (!ar.stream().good()) + if (!ar.good()) return false; } ar.end_array(); |