From f8ecd3174396fc96a503eb9d3b19acf354f83678 Mon Sep 17 00:00:00 2001 From: Lee *!* Clagett Date: Mon, 17 Mar 2025 23:01:53 -0400 Subject: [PATCH] Fix copies in ZMQ input/output --- src/serialization/json_object.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/serialization/json_object.h b/src/serialization/json_object.h index 3dfff3336c..5f23cb87c7 100644 --- a/src/serialization/json_object.h +++ b/src/serialization/json_object.h @@ -57,9 +57,7 @@ #define GET_FROM_JSON_OBJECT(source, dst, key) \ OBJECT_HAS_MEMBER_OR_THROW(source, #key) \ - decltype(dst) dstVal##key; \ - cryptonote::json::fromJsonValue(source[#key], dstVal##key); \ - dst = dstVal##key; + cryptonote::json::fromJsonValue(source[#key], dst) namespace cryptonote { @@ -377,7 +375,7 @@ inline typename std::enable_if::value, void>::type t static_assert(!std::is_same::value, "encoding an array of unsigned char is faster as hex"); dest.StartArray(); - for (auto t : vec) + for (const auto& t : vec) toJsonValue(dest, t); dest.EndArray(); }