]> wimlib.net Git - wimlib/blobdiff - src/xpress_decompress.c
decompress_common: introduce fast path for lz_copy()
[wimlib] / src / xpress_decompress.c
index 9fd5ac5eb045512b67c31831ae5499aa7ee3626e..6a0abe2a61f5233247cd215a9656f587a7aff67d 100644 (file)
@@ -138,15 +138,11 @@ xpress_decompress(const void *restrict compressed_data, size_t compressed_size,
                        }
                        length += XPRESS_MIN_MATCH_LEN;
 
-                       if (unlikely(offset > out_next - out_begin))
+                       if (unlikely(lz_copy(length, offset,
+                                            out_begin, out_next, out_end,
+                                            XPRESS_MIN_MATCH_LEN)))
                                return -1;
 
-                       if (unlikely(length > out_end - out_next))
-                               return -1;
-
-                       lz_copy(out_next, length, offset, out_end,
-                               XPRESS_MIN_MATCH_LEN);
-
                        out_next += length;
                }
        }