aboutsummaryrefslogtreecommitdiff
path: root/common/huffman.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-07-24 21:01:19 +0200
committerWillem Jan Palenstijn2017-08-24 19:46:59 +0200
commitdde259f06813534c7179a714403d8fd6fe918d09 (patch)
tree1379a5c2600057ba53032c722e3a5a1578db8507 /common/huffman.cpp
parent265fc48d1590cdd503187c79dc254d65623c8d7b (diff)
downloadscummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.tar.gz
scummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.tar.bz2
scummvm-rg350-dde259f06813534c7179a714403d8fd6fe918d09.zip
COMMON: Remove BitStream base class to allow inlining calls
All users of BitStream were in fact using a specific, hardcoded variant, so we can hardcode that variant, removing the need for virtual calls, and enabling inlining.
Diffstat (limited to 'common/huffman.cpp')
-rw-r--r--common/huffman.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/common/huffman.cpp b/common/huffman.cpp
index afb4fa00b6..3268ddf251 100644
--- a/common/huffman.cpp
+++ b/common/huffman.cpp
@@ -68,19 +68,4 @@ void Huffman::setSymbols(const uint32 *symbols) {
_symbols[i]->symbol = symbols ? *symbols++ : i;
}
-uint32 Huffman::getSymbol(BitStream &bits) const {
- uint32 code = 0;
-
- for (uint32 i = 0; i < _codes.size(); i++) {
- bits.addBit(code, i);
-
- for (CodeList::const_iterator cCode = _codes[i].begin(); cCode != _codes[i].end(); ++cCode)
- if (code == cCode->code)
- return cCode->symbol;
- }
-
- error("Unknown Huffman code");
- return 0;
-}
-
} // End of namespace Common