Drop unused GetType() from CSizeComputer

This commit is contained in:
Ben Woosley
2018-06-22 18:27:18 +00:00
parent 4e9a6f87b7
commit da74db0940
17 changed files with 33 additions and 35 deletions

View File

@@ -901,10 +901,9 @@ class CSizeComputer
protected:
size_t nSize;
const int nType;
const int nVersion;
public:
CSizeComputer(int nTypeIn, int nVersionIn) : nSize(0), nType(nTypeIn), nVersion(nVersionIn) {}
explicit CSizeComputer(int nVersionIn) : nSize(0), nVersion(nVersionIn) {}
void write(const char *psz, size_t _nSize)
{
@@ -929,7 +928,6 @@ public:
}
int GetVersion() const { return nVersion; }
int GetType() const { return nType; }
};
template<typename Stream>
@@ -980,15 +978,15 @@ inline void WriteCompactSize(CSizeComputer &s, uint64_t nSize)
}
template <typename T>
size_t GetSerializeSize(const T& t, int nType, int nVersion = 0)
size_t GetSerializeSize(const T& t, int nVersion = 0)
{
return (CSizeComputer(nType, nVersion) << t).size();
return (CSizeComputer(nVersion) << t).size();
}
template <typename S, typename T>
size_t GetSerializeSize(const S& s, const T& t)
{
return (CSizeComputer(s.GetType(), s.GetVersion()) << t).size();
return (CSizeComputer(s.GetVersion()) << t).size();
}
template <typename S, typename... T>