MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / slide_hash

Function slide_hash

extern/zlib/src/deflate.c:187–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185# endif
186#endif
187local void slide_hash(deflate_state *s) {
188 unsigned n, m;
189 Posf *p;
190 uInt wsize = s->w_size;
191
192 n = s->hash_size;
193 p = &s->head[n];
194 do {
195 m = *--p;
196 *p = (Pos)(m >= wsize ? m - wsize : NIL);
197 } while (--n);
198 n = wsize;
199#ifndef FASTEST
200 p = &s->prev[n];
201 do {
202 m = *--p;
203 *p = (Pos)(m >= wsize ? m - wsize : NIL);
204 /* If n is not on any hash chain, prev[n] is garbage but
205 * its value will never be used.
206 */
207 } while (--n);
208#endif
209}
210
211/* ===========================================================================
212 * Read a new buffer from the current input stream, update the adler32

Callers 2

fill_windowFunction · 0.85
deflateParamsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected