mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Drop unused GetType() from CSizeComputer
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user