mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 09:01:35 +01:00
Drop std/deflate's "Re-purpose the hdist variable"
This commit is contained in:
1 parent
49a431f98d
commit
5e8b448c12
5 files changed
+12
-31
No files matched your search
@@ -220,13 +220,10 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader)
|
||||
if this.history_index < hdist {
|
||||
return "#bad distance"
|
||||
}
|
||||
// Re-purpose the hdist variable as the this.history index to
|
||||
// start copying from.
|
||||
hdist = this.history_index - hdist
|
||||
|
||||
// Copy from hdist to the end of this.history.
|
||||
// Copy from this.history[(this.history_index - hdist) ..].
|
||||
n_copied = args.dst.limited_copy_u32_from_slice!(
|
||||
up_to: hlen, s: this.history[hdist & 0x7FFF ..])
|
||||
up_to: hlen, s: this.history[(this.history_index - hdist) & 0x7FFF ..])
|
||||
if n_copied < hlen {
|
||||
assert n_copied < length via "a < b: a < c; c <= b"(c: hlen)
|
||||
assert length > n_copied via "a > b: b < a"()
|
||||
|
||||
Reference in new issue
Block a user