summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/flate/level2.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/klauspost/compress/flate/level2.go')
-rw-r--r--vendor/github.com/klauspost/compress/flate/level2.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/vendor/github.com/klauspost/compress/flate/level2.go b/vendor/github.com/klauspost/compress/flate/level2.go
index dc6b1d314..5b986a194 100644
--- a/vendor/github.com/klauspost/compress/flate/level2.go
+++ b/vendor/github.com/klauspost/compress/flate/level2.go
@@ -18,7 +18,7 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) {
minNonLiteralBlockSize = 1 + 1 + inputMargin
)
- if debugDecode && e.cur < 0 {
+ if debugDeflate && e.cur < 0 {
panic(fmt.Sprint("e.cur < 0: ", e.cur))
}
@@ -83,12 +83,12 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) {
}
candidate = e.table[nextHash]
now := load6432(src, nextS)
- e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv}
+ e.table[nextHash] = tableEntry{offset: s + e.cur}
nextHash = hash4u(uint32(now), bTableBits)
offset := s - (candidate.offset - e.cur)
- if offset < maxMatchOffset && cv == candidate.val {
- e.table[nextHash] = tableEntry{offset: nextS + e.cur, val: uint32(now)}
+ if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) {
+ e.table[nextHash] = tableEntry{offset: nextS + e.cur}
break
}
@@ -98,10 +98,10 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) {
nextS++
candidate = e.table[nextHash]
now >>= 8
- e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv}
+ e.table[nextHash] = tableEntry{offset: s + e.cur}
offset = s - (candidate.offset - e.cur)
- if offset < maxMatchOffset && cv == candidate.val {
+ if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) {
break
}
cv = uint32(now)
@@ -148,7 +148,7 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) {
// Index first pair after match end.
if int(s+l+4) < len(src) {
cv := load3232(src, s)
- e.table[hash4u(cv, bTableBits)] = tableEntry{offset: s + e.cur, val: cv}
+ e.table[hash4u(cv, bTableBits)] = tableEntry{offset: s + e.cur}
}
goto emitRemainder
}
@@ -157,15 +157,15 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) {
for i := s - l + 2; i < s-5; i += 7 {
x := load6432(src, int32(i))
nextHash := hash4u(uint32(x), bTableBits)
- e.table[nextHash] = tableEntry{offset: e.cur + i, val: uint32(x)}
+ e.table[nextHash] = tableEntry{offset: e.cur + i}
// Skip one
x >>= 16
nextHash = hash4u(uint32(x), bTableBits)
- e.table[nextHash] = tableEntry{offset: e.cur + i + 2, val: uint32(x)}
+ e.table[nextHash] = tableEntry{offset: e.cur + i + 2}
// Skip one
x >>= 16
nextHash = hash4u(uint32(x), bTableBits)
- e.table[nextHash] = tableEntry{offset: e.cur + i + 4, val: uint32(x)}
+ e.table[nextHash] = tableEntry{offset: e.cur + i + 4}
}
// We could immediately start working at s now, but to improve
@@ -178,14 +178,14 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) {
o := e.cur + s - 2
prevHash := hash4u(uint32(x), bTableBits)
prevHash2 := hash4u(uint32(x>>8), bTableBits)
- e.table[prevHash] = tableEntry{offset: o, val: uint32(x)}
- e.table[prevHash2] = tableEntry{offset: o + 1, val: uint32(x >> 8)}
+ e.table[prevHash] = tableEntry{offset: o}
+ e.table[prevHash2] = tableEntry{offset: o + 1}
currHash := hash4u(uint32(x>>16), bTableBits)
candidate = e.table[currHash]
- e.table[currHash] = tableEntry{offset: o + 2, val: uint32(x >> 16)}
+ e.table[currHash] = tableEntry{offset: o + 2}
offset := s - (candidate.offset - e.cur)
- if offset > maxMatchOffset || uint32(x>>16) != candidate.val {
+ if offset > maxMatchOffset || uint32(x>>16) != load3232(src, candidate.offset-e.cur) {
cv = uint32(x >> 24)
s++
break