From 08e4497c6e3b3f434c0bb255c3942648f153fe66 Mon Sep 17 00:00:00 2001 From: Lee Clagett Date: Sun, 24 Jan 2021 07:42:57 +0000 Subject: Improve cryptonote (block and tx) binary read performance --- src/cryptonote_basic/cryptonote_format_utils.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/cryptonote_basic/cryptonote_format_utils.h') diff --git a/src/cryptonote_basic/cryptonote_format_utils.h b/src/cryptonote_basic/cryptonote_format_utils.h index b311bd2b2..3fe4c44e7 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.h +++ b/src/cryptonote_basic/cryptonote_format_utils.h @@ -148,9 +148,7 @@ namespace cryptonote template bool t_serializable_object_from_blob(t_object& to, const blobdata& b_blob) { - std::stringstream ss; - ss << b_blob; - binary_archive ba(ss); + binary_archive ba{epee::strspan(b_blob)}; bool r = ::serialization::serialize(ba, to); return r; } -- cgit v1.2.3