[spice-common 7/8] coverity: remove structurally dead code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The loop (for (;;)) will be executed only once, so, no reason for
keeping it.
---
 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;
             }
         }
 
-- 
2.7.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]