MCPcopy Create free account
hub / github.com/DFHack/dfhack / updateHashChain

Function updateHashChain

depends/lodepng/lodepng.cpp:1574–1582  ·  view source on GitHub ↗

wpos = pos & (windowsize - 1)*/

Source from the content-addressed store, hash-verified

1572
1573/*wpos = pos & (windowsize - 1)*/
1574static void updateHashChain(Hash* hash, size_t wpos, unsigned hashval, unsigned short numzeros) {
1575 hash->val[wpos] = (int)hashval;
1576 if(hash->head[hashval] != -1) hash->chain[wpos] = hash->head[hashval];
1577 hash->head[hashval] = (int)wpos;
1578
1579 hash->zeros[wpos] = numzeros;
1580 if(hash->headz[numzeros] != -1) hash->chainz[wpos] = hash->headz[numzeros];
1581 hash->headz[numzeros] = (int)wpos;
1582}
1583
1584/*
1585LZ77-encode the data. Return value is error code. The input are raw bytes, the output

Callers 1

encodeLZ77Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected