MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / slide_hash

Function slide_hash

extlibs/minizip/src/deflate.c:204–233  ·  view source on GitHub ↗

=========================================================================== * Slide the hash table when sliding the window down (could be avoided with 32 * bit values at the expense of memory usage). We slide even when level == 0 to * keep the hash table consistent if we switch back to level > 0 later. */

(s)

Source from the content-addressed store, hash-verified

202 * keep the hash table consistent if we switch back to level > 0 later.
203 */
204local void slide_hash(s)
205
206deflate_state* s;
207{
208 unsigned n, m;
209 Posf* p;
210 uInt wsize = s->w_size;
211
212 n = s->hash_size;
213 p = &s->head[n];
214 do
215 {
216 m = *--p;
217 *p = (Pos)(m >= wsize ? m - wsize : NIL);
218 }
219 while (--n);
220 n = wsize;
221#ifndef FASTEST
222 p = &s->prev[n];
223 do
224 {
225 m = *--p;
226 *p = (Pos)(m >= wsize ? m - wsize : NIL);
227 /* If n is not on any hash chain, prev[n] is garbage but
228 * its value will never be used.
229 */
230 }
231 while (--n);
232#endif
233}
234
235/* ========================================================================= */
236int ZEXPORT deflateInit_(strm, level, version, stream_size)

Callers 2

deflateParamsFunction · 0.85
fill_windowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected