Rename copy_n32_etc to limited_copy_u32_etc

This commit is contained in:
Nigel Tao committed 2020-05-27 19:55:06 +10:00
1 parent e74fd729a7
commit 1ed0f89948
10 files changed
+97 -95

No files matched your search

+6 -5
View File
@@ -226,8 +226,8 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader)
// Copy from hdist to the end of this.history.
while true {
n_copied = args.dst.copy_n32_from_slice!(
n: hlen, s: this.history[hdist & 0x7FFF .. 0x8000])
n_copied = args.dst.limited_copy_u32_from_slice!(
up_to: hlen, s: this.history[hdist & 0x7FFF .. 0x8000])
if hlen <= n_copied {
hlen = 0
break
@@ -245,8 +245,8 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader)
// Copy from the start of this.history, if we wrapped around.
if hlen > 0 {
while true {
n_copied = args.dst.copy_n32_from_slice!(
n: hlen, s: this.history[hdist & 0x7FFF .. 0x8000])
n_copied = args.dst.limited_copy_u32_from_slice!(
up_to: hlen, s: this.history[hdist & 0x7FFF .. 0x8000])
if hlen <= n_copied {
hlen = 0
break
@@ -264,7 +264,8 @@ pri func decoder.decode_huffman_slow?(dst: base.io_writer, src: base.io_reader)
}
// Copy from args.dst.
n_copied = args.dst.copy_n32_from_history!(n: length, distance: (dist_minus_1 + 1))
n_copied = args.dst.limited_copy_u32_from_history!(
up_to: length, distance: (dist_minus_1 + 1))
if length <= n_copied {
length = 0
break