Fix copies in ZMQ input/output

This commit is contained in:
Lee *!* Clagett 2025-03-17 23:01:53 -04:00
parent f90a267fa3
commit f8ecd31743

View file

@ -57,9 +57,7 @@
#define GET_FROM_JSON_OBJECT(source, dst, key) \ #define GET_FROM_JSON_OBJECT(source, dst, key) \
OBJECT_HAS_MEMBER_OR_THROW(source, #key) \ OBJECT_HAS_MEMBER_OR_THROW(source, #key) \
decltype(dst) dstVal##key; \ cryptonote::json::fromJsonValue(source[#key], dst)
cryptonote::json::fromJsonValue(source[#key], dstVal##key); \
dst = dstVal##key;
namespace cryptonote namespace cryptonote
{ {
@ -377,7 +375,7 @@ inline typename std::enable_if<sfinae::is_vector_like<Vec>::value, void>::type t
static_assert(!std::is_same<value_type, unsigned char>::value, "encoding an array of unsigned char is faster as hex"); static_assert(!std::is_same<value_type, unsigned char>::value, "encoding an array of unsigned char is faster as hex");
dest.StartArray(); dest.StartArray();
for (auto t : vec) for (const auto& t : vec)
toJsonValue(dest, t); toJsonValue(dest, t);
dest.EndArray(); dest.EndArray();
} }