Fast read path.

This commit is contained in:
Bartosz Taudul 2017-10-01 01:59:07 +02:00
parent 8f862b3271
commit 7e0eac78e1

View File

@ -25,6 +25,13 @@ public:
}
void Read( void* ptr, size_t size )
{
if( size <= BufSize - m_offset )
{
memcpy( ptr, m_buf[m_active] + m_offset, size );
m_offset += size;
}
else
{
auto dst = (char*)ptr;
while( size > 0 )
@ -47,6 +54,7 @@ public:
size -= sz;
}
}
}
private:
FileRead( FILE* f )