From 8b6d7acec51e63a6c536394d5a4571638cea306b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 10 Feb 2020 09:10:09 +0100 Subject: [PATCH] Give the compiler more posibilities for optimization --- src/map/IMG/subfile.cpp | 8 -------- src/map/IMG/subfile.h | 9 ++++++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/map/IMG/subfile.cpp b/src/map/IMG/subfile.cpp index 794987b8..42a075de 100644 --- a/src/map/IMG/subfile.cpp +++ b/src/map/IMG/subfile.cpp @@ -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; diff --git a/src/map/IMG/subfile.h b/src/map/IMG/subfile.h index d1d275a1..a87ecd27 100644 --- a/src/map/IMG/subfile.h +++ b/src/map/IMG/subfile.h @@ -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 *_blocks;