1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Give the compiler more posibilities for optimization

This commit is contained in:
Martin Tůma 2020-02-10 09:10:09 +01:00
parent 1773a1ae0d
commit 8b6d7acec5
2 changed files with 8 additions and 9 deletions

View File

@ -39,14 +39,6 @@ bool SubFile::seek(Handle &handle, quint32 pos) const
}
}
bool SubFile::readByte(Handle &handle, quint8 &val) const
{
int blockSize = handle._file ? BLOCK_SIZE : _img->blockSize();
val = handle._data.at(handle._blockPos++);
handle._pos++;
return (handle._blockPos >= blockSize) ? seek(handle, handle._pos) : true;
}
bool SubFile::readVUInt32(Handle &hdl, quint32 &val) const
{
quint8 bytes, shift, b;

View File

@ -147,7 +147,14 @@ protected:
quint32 _gmpOffset;
private:
bool readByte(Handle &handle, quint8 &val) const;
bool readByte(Handle &handle, quint8 &val) const
{
int blockSize = handle._file ? BLOCK_SIZE : _img->blockSize();
val = handle._data.at(handle._blockPos++);
handle._pos++;
return (handle._blockPos >= blockSize)
? seek(handle, handle._pos) : true;
}
IMG *_img;
QVector<quint16> *_blocks;