From 2761bca99753951e1ad8bf51e3fce8fd309b4612 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 13 Mar 2018 16:35:01 -0700 Subject: [PATCH] Merge READWRITEMANY into READWRITE --- src/serialize.h | 28 +--------------------------- src/test/serialize_tests.cpp | 2 +- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index dcc8d8691e..862fe39e45 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -148,8 +148,7 @@ enum SER_GETHASH = (1 << 2), }; -#define READWRITE(obj) (::SerReadWrite(s, (obj), ser_action)) -#define READWRITEMANY(...) (::SerReadWriteMany(s, ser_action, __VA_ARGS__)) +#define READWRITE(...) (::SerReadWriteMany(s, ser_action, __VA_ARGS__)) /** * Implement three methods for serializable objects. These are actually wrappers over @@ -825,19 +824,6 @@ struct CSerActionUnserialize constexpr bool ForRead() const { return true; } }; -template -inline void SerReadWrite(Stream& s, const T& obj, CSerActionSerialize ser_action) -{ - ::Serialize(s, obj); -} - -template -inline void SerReadWrite(Stream& s, T& obj, CSerActionUnserialize ser_action) -{ - ::Unserialize(s, obj); -} - - @@ -897,12 +883,6 @@ void SerializeMany(Stream& s) { } -template -void SerializeMany(Stream& s, Arg&& arg) -{ - ::Serialize(s, std::forward(arg)); -} - template void SerializeMany(Stream& s, Arg&& arg, Args&&... args) { @@ -915,12 +895,6 @@ inline void UnserializeMany(Stream& s) { } -template -inline void UnserializeMany(Stream& s, Arg& arg) -{ - ::Unserialize(s, arg); -} - template inline void UnserializeMany(Stream& s, Arg& arg, Args&... args) { diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index 4595519435..42fd59380a 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -53,7 +53,7 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action) { - READWRITEMANY(intval, boolval, stringval, FLATDATA(charstrval), txval); + READWRITE(intval, boolval, stringval, FLATDATA(charstrval), txval); } };