mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
Simplify deflate's decoder.decode_uncompressed
This commit is contained in:
1 parent
84724a76a2
commit
a8767f285b
2 files changed
+3
-5
No files matched your search
+2
-3
@@ -2183,8 +2183,8 @@ static wuffs_deflate__status wuffs_deflate__decoder__decode_uncompressed(
|
|||||||
v_n_copied = wuffs_base__io_writer__copy_from_reader32(
|
v_n_copied = wuffs_base__io_writer__copy_from_reader32(
|
||||||
&b_wptr_dst, b_wend_dst, &b_rptr_src, b_rend_src, v_length);
|
&b_wptr_dst, b_wend_dst, &b_rptr_src, b_rend_src, v_length);
|
||||||
if (v_length <= v_n_copied) {
|
if (v_length <= v_n_copied) {
|
||||||
v_length = 0;
|
status = WUFFS_DEFLATE__STATUS_OK;
|
||||||
goto label_0_break;
|
goto ok;
|
||||||
}
|
}
|
||||||
v_length -= v_n_copied;
|
v_length -= v_n_copied;
|
||||||
if (((uint64_t)(b_wend_dst - b_wptr_dst)) == 0) {
|
if (((uint64_t)(b_wend_dst - b_wptr_dst)) == 0) {
|
||||||
@@ -2195,7 +2195,6 @@ static wuffs_deflate__status wuffs_deflate__decoder__decode_uncompressed(
|
|||||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(4);
|
WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
label_0_break:;
|
|
||||||
|
|
||||||
goto ok;
|
goto ok;
|
||||||
ok:
|
ok:
|
||||||
|
|||||||
@@ -231,8 +231,7 @@ pri func decoder.decode_uncompressed?(dst base.io_writer, src base.io_reader)()
|
|||||||
while true {
|
while true {
|
||||||
var n_copied base.u32 = in.dst.copy_from_reader32(r:in.src, length:length)
|
var n_copied base.u32 = in.dst.copy_from_reader32(r:in.src, length:length)
|
||||||
if length <= n_copied {
|
if length <= n_copied {
|
||||||
length = 0
|
return
|
||||||
break
|
|
||||||
}
|
}
|
||||||
length -= n_copied
|
length -= n_copied
|
||||||
if in.dst.available() == 0 {
|
if in.dst.available() == 0 {
|
||||||
|
|||||||
Reference in new issue
Block a user