aboutsummaryrefslogtreecommitdiff
path: root/src/lzsshuffman/lzsshuffmandecoder.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/lzsshuffman/lzsshuffmandecoder.nim')
-rw-r--r--src/lzsshuffman/lzsshuffmandecoder.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lzsshuffman/lzsshuffmandecoder.nim b/src/lzsshuffman/lzsshuffmandecoder.nim
index cd71914..a307774 100644
--- a/src/lzsshuffman/lzsshuffmandecoder.nim
+++ b/src/lzsshuffman/lzsshuffmandecoder.nim
@@ -14,9 +14,8 @@
14# You should have received a copy of the GNU Affero General Public License 14# You should have received a copy of the GNU Affero General Public License
15# along with this program. If not, see <https://www.gnu.org/licenses/>. 15# along with this program. If not, see <https://www.gnu.org/licenses/>.
16 16
17import lists
18import ../bitio/bitreader 17import ../bitio/bitreader
19import ../lzss/listpolyfill, ../lzss/lzssnode, ../lzss/lzsschain 18import ../lzss/lzssnode, ../lzss/lzsschain
20import ../huffman/huffmantree, ../huffman/huffmandecoder 19import ../huffman/huffmantree, ../huffman/huffmandecoder
21import lzsshuffmansymbol 20import lzsshuffmansymbol
22 21
@@ -26,9 +25,9 @@ proc readChain*(bitReader: BitReader, symbolDecoder, positionDecoder: HuffmanDec
26 while not symbol.isEndMarker(): 25 while not symbol.isEndMarker():
27 if byteCursor > maxDataByteLength: raise newException(IOError, "lzss block too long") 26 if byteCursor > maxDataByteLength: raise newException(IOError, "lzss block too long")
28 if symbol.isCharacter(): 27 if symbol.isCharacter():
29 chain.append(lzssCharacter(symbol.uint8)) 28 chain.add(lzssCharacter(symbol.uint8))
30 else: 29 else:
31 let position = positionDecoder.decode(bitReader) 30 let position = positionDecoder.decode(bitReader)
32 chain.append(unpackLzssReference(symbol, position)) 31 chain.add(unpackLzssReference(symbol, position))
33 (symbol, byteCursor) = (symbolDecoder.decode(bitReader).Symbol, byteCursor + 1) 32 (symbol, byteCursor) = (symbolDecoder.decode(bitReader).Symbol, byteCursor + 1)
34 chain 33 chain