Add while label to std/deflate decode_huffman_slow

This commit is contained in:
Nigel Tao committed 2021-11-20 20:14:37 +11:00
1 parent bb8623b472
commit ede0590ead
2 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -201,7 +201,7 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader)
n_bits -= table_entry_n_bits
}
while true {
while.inner true {
// Copy from this.history.
if ((dist_minus_1 + 1) as base.u64) > args.dst.history_length() {
// Set (hlen, hdist) to be the length-distance pair to copy
@@ -255,11 +255,11 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader)
up_to: length, distance: (dist_minus_1 + 1))
if length <= n_copied {
length = 0
break
break.inner
}
length -= n_copied
yield? base."$short write"
} endwhile
} endwhile.inner
} endwhile.loop
// TODO: "assert n_bits < 8"? What about (bits >> n_bits)?