1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

Some hot path inlining

This commit is contained in:
Martin Tůma 2020-02-01 19:21:41 +01:00
parent d16ef7b081
commit ca204626a1
2 changed files with 10 additions and 25 deletions

View File

@ -23,29 +23,6 @@ HuffmanStream::HuffmanStream(const SubFile &file, SubFile::Handle &hdl,
} }
} }
bool HuffmanStream::readNext(qint32 &lonDelta, qint32 &latDelta)
{
if (!readDelta(_lonSign, lonDelta))
return false;
if (!readDelta(_latSign, latDelta))
return false;
if (!(lonDelta|latDelta))
return false;
return true;
}
bool HuffmanStream::readOffset(qint32 &lonDelta, qint32 &latDelta)
{
if (!readDelta(1, lonDelta))
return false;
if (!readDelta(1, latDelta))
return false;
return true;
}
bool HuffmanStream::sign(int &val) bool HuffmanStream::sign(int &val)
{ {
quint32 bit; quint32 bit;

View File

@ -9,8 +9,16 @@ public:
HuffmanStream(const SubFile &file, SubFile::Handle &hdl, quint32 length, HuffmanStream(const SubFile &file, SubFile::Handle &hdl, quint32 length,
const HuffmanTable &table, bool line); const HuffmanTable &table, bool line);
bool readNext(qint32 &lonDelta, qint32 &latDelta); bool readNext(qint32 &lonDelta, qint32 &latDelta)
bool readOffset(qint32 &lonDelta, qint32 &latDelta); {
if (!(readDelta(_lonSign, lonDelta) && readDelta(_latSign, latDelta)))
return false;
return (lonDelta || latDelta);
}
bool readOffset(qint32 &lonDelta, qint32 &latDelta)
{return (readDelta(1, lonDelta) && readDelta(1, latDelta));}
bool atEnd() const bool atEnd() const
{return _symbolDataSize + bitsAvailable() < _table.maxSymbolSize();} {return _symbolDataSize + bitsAvailable() < _table.maxSymbolSize();}