From c65e815b69d1eb1ac86636e70d8b66ebcf40052e Mon Sep 17 00:00:00 2001 From: vng Date: Sun, 19 Dec 2010 01:23:53 +0200 Subject: [PATCH] Remove overhead --- coding/byte_stream.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/coding/byte_stream.hpp b/coding/byte_stream.hpp index 0bc7d613ac..cbdec631c3 100644 --- a/coding/byte_stream.hpp +++ b/coding/byte_stream.hpp @@ -38,22 +38,22 @@ template > class PushBackByteSink { public: explicit PushBackByteSink(TStorage & storage) - : m_Storage(storage), m_InitialStorageSize(storage.size()) + : m_Storage(storage)//, m_InitialStorageSize(storage.size()) { } void Write(void const * p, size_t size) { - m_Storage.insert(m_Storage.end(), - static_cast(p), - static_cast(p) + size); + // assume input buffer as buffer of bytes + unsigned char const * pp = static_cast(p); + m_Storage.insert(m_Storage.end(), pp, pp + size); } - size_t BytesWritten() const - { - return m_Storage.size() - m_InitialStorageSize; - } + //size_t BytesWritten() const + //{ + // return m_Storage.size() - m_InitialStorageSize; + //} private: TStorage & m_Storage; - size_t m_InitialStorageSize; + //size_t m_InitialStorageSize; };