From 49b5b3c03c42b962417c0047fec2536f66faf0c1 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 5 Dec 2020 23:11:41 +1100 Subject: [PATCH] Remove redundant loop condition in std/bmp --- release/c/wuffs-unsupported-snapshot.c | 2 +- std/bmp/decode_bmp.wuffs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 16dbc61f..9f037487 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -17320,7 +17320,7 @@ wuffs_bmp__decoder__swizzle_compress3( v_p1_temp = (self->private_impl.f_width - self->private_impl.f_dst_x); v_p1 = wuffs_base__u32__min(v_p1_temp, 256); v_p0 = 0; - while ((v_p0 < v_p1) && (((uint64_t)(io2_a_src - iop_a_src)) >= 2)) { + while (v_p0 < v_p1) { if (self->private_impl.f_bits_per_pixel == 16) { if (((uint64_t)(io2_a_src - iop_a_src)) < 2) { goto label__0__break; diff --git a/std/bmp/decode_bmp.wuffs b/std/bmp/decode_bmp.wuffs index 254ed6bf..4d378452 100644 --- a/std/bmp/decode_bmp.wuffs +++ b/std/bmp/decode_bmp.wuffs @@ -499,7 +499,7 @@ pri func decoder.swizzle_compress3!(dst: ptr base.pixel_buffer, src: base.io_rea p1_temp = this.width ~mod- this.dst_x p1 = p1_temp.min(a: 256) p0 = 0 - while (p0 < p1) and (args.src.length() >= 2) { + while p0 < p1 { assert p0 < 256 via "a < b: a < c; c <= b"(c: p1) if this.bits_per_pixel == 16 { if args.src.length() < 2 {