mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 16:47:28 +01:00
Prepare for introducing copy_from_slice.
This commit is contained in:
1 parent
36ba4b866c
commit
66f712039b
3 files changed
+37
-16
No files matched your search
@@ -105,10 +105,17 @@ pub func lzw_decoder.decode?(dst writer1, src reader1)() {
|
||||
this.stack[4095] = c as u8
|
||||
}
|
||||
|
||||
// TODO: the "x:s" arg is a placeholder, and should be something
|
||||
// like (this.stack[s:]), which means defining a slice type (and
|
||||
// type checking, bounds checking and code generation for it).
|
||||
in.dst.write?(x:s)
|
||||
while true,
|
||||
inv n_bits < 8,
|
||||
inv c < 256,
|
||||
{
|
||||
var expansion[] u8 = this.stack[s:]
|
||||
// TODO: change write to copy_from_slice.
|
||||
in.dst.write?(x:expansion)
|
||||
if expansion.length() == 0 { // Avoid "unused variable" C compiler warning.
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
if save_code <= 4095 {
|
||||
this.suffixes[save_code] = c as u8
|
||||
|
||||
Reference in new issue
Block a user