From a8f756eabfa7dfd79f265dd8efb6c9b8b833ac58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 4 Apr 2016 08:40:01 +0200 Subject: [PATCH] coverity: remove structurally dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The loop (for (;;)) will be executed only once, so, no reason for keeping it. Signed-off-by: Fabiano FidĂȘncio Acked-by: Christophe Fergeau --- common/lz_compress_tmpl.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/common/lz_compress_tmpl.c b/common/lz_compress_tmpl.c index e316c4b..0305278 100644 --- a/common/lz_compress_tmpl.c +++ b/common/lz_compress_tmpl.c @@ -323,18 +323,15 @@ match: // RLE or dictionary (both are encoded by distance from ref (-1) a // TODO: maybe separate a run from the same seg or from different ones in order // to spare ref < ref_limit and that way we can also perform 8 calls of // (ref++ != ip++) outside a loop - for (;;) { - while ((ip < ip_bound) && (ref < ref_limit)) { - if (!SAME_PIXEL(*ref, *ip)) { - ref++; - ip++; - break; - } else { - ref++; - ip++; - } + while ((ip < ip_bound) && (ref < ref_limit)) { + if (!SAME_PIXEL(*ref, *ip)) { + ref++; + ip++; + break; + } else { + ref++; + ip++; } - break; } }