From 657e05ab2e87ff725723fe8a375fc3f8aad02126 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 28 Oct 2016 16:51:33 -0700 Subject: Make GetSerializeSize a wrapper on top of CSizeComputer Given that in default GetSerializeSize implementations created by ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid of the specialized GetSerializeSize methods everywhere, and just use CSizeComputer. This removes a lot of code which isn't actually used anywhere. For CCompactSize and CVarInt this actually removes a more efficient size computing algorithm, which is brought back in a later commit. --- src/streams.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/streams.h') diff --git a/src/streams.h b/src/streams.h index 12a36a4a7..d9965b534 100644 --- a/src/streams.h +++ b/src/streams.h @@ -308,13 +308,6 @@ public: s.write((char*)&vch[0], vch.size() * sizeof(vch[0])); } - template - unsigned int GetSerializeSize(const T& obj) - { - // Tells the size of the object if serialized to this stream - return ::GetSerializeSize(obj, nType, nVersion); - } - template CDataStream& operator<<(const T& obj) { @@ -457,13 +450,6 @@ public: throw std::ios_base::failure("CAutoFile::write: write failed"); } - template - unsigned int GetSerializeSize(const T& obj) - { - // Tells the size of the object if serialized to this stream - return ::GetSerializeSize(obj, nType, nVersion); - } - template CAutoFile& operator<<(const T& obj) { -- cgit v1.2.3