// deflate state
length int
offset int
- hash uint32
maxInsertIndex int
err error
// Set the head of the hash chain to us.
*hh = uint32(di + d.hashOffset)
}
- d.hash = newH
}
// Update window information.
d.windowEnd = n
d.offset = 0
d.byteAvailable = false
d.index = 0
- d.hash = 0
d.chainHead = -1
d.bulkHasher = bulkHash4
}
}
d.maxInsertIndex = d.windowEnd - (minMatchLength - 1)
- if d.index < d.maxInsertIndex {
- d.hash = hash4(d.window[d.index : d.index+minMatchLength])
- }
Loop:
for {
}
if d.index < d.maxInsertIndex {
// Update the hash
- d.hash = hash4(d.window[d.index : d.index+minMatchLength])
- hh := &d.hashHead[d.hash&hashMask]
+ hash := hash4(d.window[d.index : d.index+minMatchLength])
+ hh := &d.hashHead[hash&hashMask]
d.chainHead = int(*hh)
d.hashPrev[d.index&windowMask] = uint32(d.chainHead)
*hh = uint32(d.index + d.hashOffset)
index := d.index
for index++; index < newIndex; index++ {
if index < d.maxInsertIndex {
- d.hash = hash4(d.window[index : index+minMatchLength])
+ hash := hash4(d.window[index : index+minMatchLength])
// Get previous value with the same hash.
// Our chain should point to the previous value.
- hh := &d.hashHead[d.hash&hashMask]
+ hh := &d.hashHead[hash&hashMask]
d.hashPrev[index&windowMask] = *hh
// Set the head of the hash chain to us.
*hh = uint32(index + d.hashOffset)
// For matches this long, we don't bother inserting each individual
// item into the table.
d.index += d.length
- if d.index < d.maxInsertIndex {
- d.hash = hash4(d.window[d.index : d.index+minMatchLength])
- }
}
if len(d.tokens) == maxFlateBlockTokens {
// The block includes the current character
d.tokens = d.tokens[:0]
d.length = minMatchLength - 1
d.offset = 0
- d.hash = 0
d.maxInsertIndex = 0
}
}