]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
compression: Remove redundant nibble_index check
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 7 Mar 2022 07:28:05 +0000 (20:28 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 May 2022 02:22:35 +0000 (02:22 +0000)
If nibble_index is non-zero, we have already written to it, and so don't
need to check again that it is in bounds.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/compression/lzxpress.c

index 222a5119c9f59df40472ffd90049eb2fcd792fc7..b7b365f165c1913e7781fbe035c8fa106e9501e2 100644 (file)
@@ -158,7 +158,6 @@ ssize_t lzxpress_compress(const uint8_t *uncompressed,
                                        compressed[nibble_index] = MIN(match_len, 15);
                                        compressed_pos += sizeof(uint8_t);
                                } else {
-                                       __CHECK_BYTES(max_compressed_size, nibble_index, sizeof(uint8_t));
                                        compressed[nibble_index] |= MIN(match_len, 15) << 4;
                                        nibble_index = 0;
                                }