Convert serialization code to use less virtuals and allow more inlining.

This was SVN commit r7582.
This commit is contained in:
Ykkrosh
2010-05-25 19:01:30 +00:00
parent 9090d25ef8
commit 01bec7a454
12 changed files with 250 additions and 201 deletions
@@ -20,22 +20,27 @@
#include "HashSerializer.h"
CHashSerializer::CHashSerializer(ScriptInterface& scriptInterface) :
CBinarySerializer(scriptInterface)
CBinarySerializer<CHashSerializerImpl>(scriptInterface)
{
}
size_t CHashSerializer::GetHashLength()
{
return HashFunc::DIGESTSIZE;
return m_Impl.GetHashLength();
}
const u8* CHashSerializer::ComputeHash()
{
return m_Impl.ComputeHash();
}
size_t CHashSerializerImpl::GetHashLength()
{
return HashFunc::DIGESTSIZE;
}
const u8* CHashSerializerImpl::ComputeHash()
{
m_Hash.Final(m_HashData);
return m_HashData;
}
void CHashSerializer::Put(const char* UNUSED(name), const u8* data, size_t len)
{
m_Hash.Update(data, len);
}