diff options
author | pacien | 2018-11-30 12:33:09 +0100 |
---|---|---|
committer | pacien | 2018-11-30 12:35:46 +0100 |
commit | ec045869d02d033f2614e7162b100bae9b2580ba (patch) | |
tree | 98ef53efd855660dc81c2ba58f3a3325453661e0 /src/huffmantree.nim | |
parent | ccc45ad33b3da9e415ef35a393930cde1136ae99 (diff) | |
download | gziplike-ec045869d02d033f2614e7162b100bae9b2580ba.tar.gz |
add huffman decoder
Diffstat (limited to 'src/huffmantree.nim')
-rw-r--r-- | src/huffmantree.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/huffmantree.nim b/src/huffmantree.nim index c57b55c..44c9990 100644 --- a/src/huffmantree.nim +++ b/src/huffmantree.nim | |||
@@ -24,12 +24,12 @@ type HuffmanTreeNodeKind* = enum | |||
24 | leaf | 24 | leaf |
25 | 25 | ||
26 | type HuffmanTreeNode*[T: SomeUnsignedInt] = ref object | 26 | type HuffmanTreeNode*[T: SomeUnsignedInt] = ref object |
27 | case kind: HuffmanTreeNodeKind | 27 | case kind*: HuffmanTreeNodeKind |
28 | of branch: | 28 | of branch: |
29 | left, right: HuffmanTreeNode[T] | 29 | left*, right*: HuffmanTreeNode[T] |
30 | maxChildValue: T | 30 | maxChildValue: T |
31 | of leaf: | 31 | of leaf: |
32 | value: T | 32 | value*: T |
33 | weight: int | 33 | weight: int |
34 | 34 | ||
35 | proc huffmanBranch*[T](left, right: HuffmanTreeNode[T]): HuffmanTreeNode[T] = | 35 | proc huffmanBranch*[T](left, right: HuffmanTreeNode[T]): HuffmanTreeNode[T] = |