From: Hans Kristian Rosbach Date: Thu, 11 Jun 2015 15:05:30 +0000 (+0200) Subject: Improve dictionary handling. X-Git-Tag: 1.9.9-b1~799 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c81cad987823f5f0bbb9aabda387ca94066e4ab9;p=thirdparty%2Fzlib-ng.git Improve dictionary handling. Based on commit e07ac7d8 from Cloudflare's fork, by Vlad Krasnov. --- diff --git a/deflate.c b/deflate.c index 65ea7537f..395fd46d1 100644 --- a/deflate.c +++ b/deflate.c @@ -386,13 +386,8 @@ int ZEXPORT deflateSetDictionary(z_stream *strm, const unsigned char *dictionary while (s->lookahead >= MIN_MATCH) { str = s->strstart; n = s->lookahead - (MIN_MATCH-1); - do { - UPDATE_HASH(s, s->ins_h, str); - s->prev[str & s->w_mask] = s->head[s->ins_h]; - s->head[s->ins_h] = (Pos)str; - str++; - } while (--n); - s->strstart = str; + bulk_insert_str(s, str, n); + s->strstart = str + n; s->lookahead = MIN_MATCH-1; fill_window(s); }