From 7fe82b12fe5eed490b3e9eea1699c4bbea826dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 24 Oct 2021 12:56:09 +0200 Subject: [PATCH] Code cleanup --- src/map/IMG/huffmantable.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/map/IMG/huffmantable.cpp b/src/map/IMG/huffmantable.cpp index 930bfebe..cbee4831 100644 --- a/src/map/IMG/huffmantable.cpp +++ b/src/map/IMG/huffmantable.cpp @@ -67,16 +67,15 @@ quint32 HuffmanTable::symbol(quint32 data, quint8 &size) const tp = _bsrchTable + (m * _bsrchEntryBytes); quint32 nd = readVUint32(tp, _symBytes); - if (data <= nd) { - if (data == nd) - lo = m; - else - tp = prev; - - hi = m - (data < nd); - m = lo; + if (data < nd) { + tp = prev; + hi = m - 1; + } else if (data > nd) { + lo = m; + } else { + lo = m; + hi = m; } - lo = m; } quint32 i = readVUint32(tp, _symBytes);