summaryrefslogtreecommitdiff
path: root/insert_string_tpl.h
diff options
context:
space:
mode:
authorHans Kristian Rosbach <hk-git@circlestorm.org>2020-08-20 16:09:23 +0200
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-08-21 09:46:03 +0200
commit0cd1818e8669423815626de48c00b3334d2875cb (patch)
tree639c1a04824bd8a7a3c4580f642a75b8dd673d6e /insert_string_tpl.h
parent5b5677abd326e9ad2cda16edf4aa9dc3ec6a1171 (diff)
Remove return value from insert_string, since it is always ignored and
quick_insert_string is being used instead.
Diffstat (limited to 'insert_string_tpl.h')
-rw-r--r--insert_string_tpl.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/insert_string_tpl.h b/insert_string_tpl.h
index f5d61ce..d667231 100644
--- a/insert_string_tpl.h
+++ b/insert_string_tpl.h
@@ -60,13 +60,12 @@ ZLIB_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str
* input characters and the first MIN_MATCH bytes of str are valid
* (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 = 0, idx;
+ZLIB_INTERNAL void INSERT_STRING(deflate_state *const s, const uint32_t str, uint32_t count) {
uint8_t *strstart = s->window + str;
uint8_t *strend = strstart + count - 1; /* last position */
uint32_t hash_mask = s->hash_mask;
- for (idx = str; strstart <= strend; idx++, strstart++) {
+ for (Pos idx = str; strstart <= strend; idx++, strstart++) {
uint32_t val, hm, h = 0;
#ifdef UNALIGNED_OK
@@ -81,13 +80,11 @@ ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint
UPDATE_HASH(s, h, val);
hm = h & hash_mask;
- head = s->head[hm];
+ Pos head = s->head[hm];
if (LIKELY(head != idx)) {
s->prev[idx & s->w_mask] = head;
s->head[hm] = idx;
}
}
-
- return head;
}
#endif