package flate
type fastEncL4 struct {
fastGen
table [tableSize]tableEntry
bTable [tableSize]tableEntry
}
func ( *fastEncL4) ( *tokens, []byte) {
const (
= 12 - 1
= 1 + 1 +
= 4
)
for .cur >= bufferReset {
if len(.hist) == 0 {
clear(.table[:])
clear(.bTable[:])
.cur = maxMatchOffset
break
}
:= .cur + int32(len(.hist)) - maxMatchOffset
for := range .table[:] {
:= .table[].offset
if <= {
= 0
} else {
= - .cur + maxMatchOffset
}
.table[].offset =
}
for := range .bTable[:] {
:= .bTable[].offset
if <= {
= 0
} else {
= - .cur + maxMatchOffset
}
.bTable[].offset =
}
.cur = maxMatchOffset
}
:= .addBlock()
if len() < {
.n = uint16(len())
return
}
= .hist
:=
:= int32(len() - )
:= loadLE64(, )
for {
const = 6
const = 1
:=
var int32
for {
:= hashLen(, tableBits, )
:= hashLen(, tableBits, hashLongBytes)
=
= + + (-)>>
if > {
goto
}
:= .table[]
:= .bTable[]
:= loadLE64(, )
:= tableEntry{offset: + .cur}
.table[] =
.bTable[] =
= .offset - .cur
if - < maxMatchOffset && uint32() == loadLE32(, ) {
break
}
= .offset - .cur
if - < maxMatchOffset && uint32() == loadLE32(, ) {
= .bTable[hashLen(, tableBits, hashLongBytes)]
:= .offset - .cur
if - < maxMatchOffset && loadLE32(, ) == uint32() {
, := matchLen([+4:], [+4:]), matchLen([+4:], [-+4:])
if > {
=
= .offset - .cur
}
}
break
}
=
}
:= .matchLenLong(int(+4), int(+4), ) + 4
for > 0 && > && [-1] == [-1] {
--
--
++
}
if < {
for , := range [:] {
.tokens[.n] = token()
.litHist[]++
.n++
}
}
.AddMatchLong(, uint32(--baseMatchOffset))
+=
=
if >= {
= + 1
}
if >= {
if int(+8) < len() {
:= loadLE64(, )
.table[hashLen(, tableBits, )] = tableEntry{offset: + .cur}
.bTable[hashLen(, tableBits, hashLongBytes)] = tableEntry{offset: + .cur}
}
goto
}
:=
if < -1 {
:= loadLE64(, )
:= tableEntry{offset: + .cur}
:= tableEntry{offset: .offset + 1}
.bTable[hashLen(, tableBits, hashLongBytes)] =
.bTable[hashLen(>>8, tableBits, hashLongBytes)] =
.table[hashLen(>>8, tableBits, )] =
+= 3
for ; < -1; += 3 {
:= loadLE64(, )
:= tableEntry{offset: + .cur}
:= tableEntry{offset: .offset + 1}
.bTable[hashLen(, tableBits, hashLongBytes)] =
.bTable[hashLen(>>8, tableBits, hashLongBytes)] =
.table[hashLen(>>8, tableBits, )] =
}
}
:= loadLE64(, -1)
:= .cur + - 1
:= hashLen(, tableBits, )
:= hashLen(, tableBits, hashLongBytes)
.table[] = tableEntry{offset: }
.bTable[] = tableEntry{offset: }
= >> 8
}
:
if int() < len() {
if .n == 0 {
return
}
emitLiterals(, [:])
}
}