From a4b14a0f172aa5b72162ce48cf8f8ac17ec2f131 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Tue, 25 Jan 2022 14:29:18 +1100 Subject: [PATCH] Simpify std/png "yield short read" loop --- release/c/wuffs-unsupported-snapshot.c | 3 +-- std/png/decode_png.wuffs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 1d5298df..9a3f8c85 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -40554,9 +40554,8 @@ wuffs_png__decoder__decode_frame( wuffs_png__decoder__filter_and_swizzle(self, a_dst, wuffs_base__slice_u8__subslice_j(a_workbuf, self->private_impl.f_workbuf_wi)); } while (true) { - status = v_status; + status = wuffs_base__make_status(wuffs_base__suspension__short_read); WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(6); - v_status = wuffs_base__make_status(wuffs_base__suspension__short_read); } } status = v_status; diff --git a/std/png/decode_png.wuffs b/std/png/decode_png.wuffs index 7f9d37f8..f66fae2e 100644 --- a/std/png/decode_png.wuffs +++ b/std/png/decode_png.wuffs @@ -1209,8 +1209,7 @@ pub func decoder.decode_frame?(dst: ptr base.pixel_buffer, src: base.io_reader, this.filter_and_swizzle!(dst: args.dst, workbuf: args.workbuf[.. this.workbuf_wi]) } while true { - yield? status - status = base."$short read" + yield? base."$short read" } endwhile } yield? status