Skip to content

Commit

Permalink
Add one explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jvns committed Feb 22, 2015
1 parent c4ddcc8 commit af604ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions print_huffman_table.py
Expand Up @@ -12,6 +12,9 @@ def generate_codes(lengths):
if last_length == length:
code = last_code + 1
else:
# Figure out what the first code for each bit-length would
# be. This is one more than the last code of the previous
# bit length, left-shifted once.
code = (last_code + 1) << 1
last_code = code
last_length = length
Expand Down

0 comments on commit af604ff

Please sign in to comment.