diff options
author | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2020-08-19 10:50:44 +0200 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-08-21 09:46:03 +0200 |
commit | 5b5677abd326e9ad2cda16edf4aa9dc3ec6a1171 (patch) | |
tree | 83268cf3bb032c84b0a29b9d33a758faa77dfd38 /insert_string_tpl.h | |
parent | 9b6af1519cc582cdcc02a405f27252ce13832bee (diff) |
Now that the check is out of the loop, it is also safe to remove it
and unconditionally return head.
Diffstat (limited to 'insert_string_tpl.h')
-rw-r--r-- | insert_string_tpl.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/insert_string_tpl.h b/insert_string_tpl.h index b37dae2..f5d61ce 100644 --- a/insert_string_tpl.h +++ b/insert_string_tpl.h @@ -61,7 +61,7 @@ ZLIB_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str * (except for the last MIN_MATCH-1 bytes of the input file). */ ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint32_t count) { - Pos head, idx, ret = 0; + Pos head = 0, idx; uint8_t *strstart = s->window + str; uint8_t *strend = strstart + count - 1; /* last position */ uint32_t hash_mask = s->hash_mask; @@ -88,12 +88,6 @@ ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint } } - if (strstart == strend) { - if (head != idx) - ret = head; - else - ret = idx; - } - return ret; + return head; } #endif |