mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-12 19:31:47 +00:00
No need to check if file has ended.
This commit is contained in:
parent
4d892cbae9
commit
ebf2c3ad5b
@ -367,26 +367,19 @@ private:
|
|||||||
|
|
||||||
void ReadBlock( uint32_t sz )
|
void ReadBlock( uint32_t sz )
|
||||||
{
|
{
|
||||||
if( m_dataOffset < m_dataSize )
|
if( m_stream )
|
||||||
{
|
{
|
||||||
if( m_stream )
|
m_lastBlock = (size_t)LZ4_decompress_safe_continue( m_stream, m_data + m_dataOffset, m_second, sz, BufSize );
|
||||||
{
|
m_dataOffset += sz;
|
||||||
m_lastBlock = (size_t)LZ4_decompress_safe_continue( m_stream, m_data + m_dataOffset, m_second, sz, BufSize );
|
|
||||||
m_dataOffset += sz;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ZSTD_outBuffer out = { m_second, BufSize, 0 };
|
|
||||||
ZSTD_inBuffer in = { m_data + m_dataOffset, sz, 0 };
|
|
||||||
m_dataOffset += sz;
|
|
||||||
const auto ret = ZSTD_decompressStream( m_streamZstd, &out, &in );
|
|
||||||
assert( ret > 0 );
|
|
||||||
m_lastBlock = out.pos;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_lastBlock = 0;
|
ZSTD_outBuffer out = { m_second, BufSize, 0 };
|
||||||
|
ZSTD_inBuffer in = { m_data + m_dataOffset, sz, 0 };
|
||||||
|
m_dataOffset += sz;
|
||||||
|
const auto ret = ZSTD_decompressStream( m_streamZstd, &out, &in );
|
||||||
|
assert( ret > 0 );
|
||||||
|
m_lastBlock = out.pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user