@@ -92,7 +92,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
92
92
var t int32
93
93
for {
94
94
nextHashS := hashLen (cv , tableBits , hashShortBytes )
95
- nextHashL := hash7 (cv , tableBits )
95
+ nextHashL := hashLen (cv , tableBits , hashLongBytes )
96
96
97
97
s = nextS
98
98
nextS = s + doEvery + (s - nextEmit )>> skipLog
@@ -109,7 +109,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
109
109
eLong .Cur , eLong .Prev = entry , eLong .Cur
110
110
111
111
nextHashS = hashLen (next , tableBits , hashShortBytes )
112
- nextHashL = hash7 (next , tableBits )
112
+ nextHashL = hashLen (next , tableBits , hashLongBytes )
113
113
114
114
t = lCandidate .Cur .offset - e .cur
115
115
if s - t < maxMatchOffset {
@@ -196,7 +196,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
196
196
// The skipped bytes are tested in Extend backwards,
197
197
// and still picked up as part of the match if they do.
198
198
const skipBeginning = 2
199
- eLong := e .bTable [hash7 (loadLE64 (src , sAt ), tableBits )].Cur .offset
199
+ eLong := e .bTable [hashLen (loadLE64 (src , sAt ), tableBits , hashLongBytes )].Cur .offset
200
200
t2 := eLong - e .cur - l + skipBeginning
201
201
s2 := s + skipBeginning
202
202
off := s2 - t2
@@ -241,13 +241,13 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
241
241
cv := loadLE64 (src , i )
242
242
t := tableEntry {offset : i + e .cur }
243
243
e .table [hashLen (cv , tableBits , hashShortBytes )] = t
244
- eLong := & e .bTable [hash7 (cv , tableBits )]
244
+ eLong := & e .bTable [hashLen (cv , tableBits , hashLongBytes )]
245
245
eLong .Cur , eLong .Prev = t , eLong .Cur
246
246
247
247
// Do an long at i+1
248
248
cv >>= 8
249
249
t = tableEntry {offset : t .offset + 1 }
250
- eLong = & e .bTable [hash7 (cv , tableBits )]
250
+ eLong = & e .bTable [hashLen (cv , tableBits , hashLongBytes )]
251
251
eLong .Cur , eLong .Prev = t , eLong .Cur
252
252
253
253
// We only have enough bits for a short entry at i+2
@@ -261,7 +261,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
261
261
cv := loadLE64 (src , i )
262
262
t := tableEntry {offset : i + e .cur }
263
263
t2 := tableEntry {offset : t .offset + 1 }
264
- eLong := & e .bTable [hash7 (cv , tableBits )]
264
+ eLong := & e .bTable [hashLen (cv , tableBits , hashLongBytes )]
265
265
eLong .Cur , eLong .Prev = t , eLong .Cur
266
266
e .table [hashLen (cv >> 8 , tableBits , hashShortBytes )] = t2
267
267
}
@@ -272,7 +272,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
272
272
x := loadLE64 (src , s - 1 )
273
273
o := e .cur + s - 1
274
274
prevHashS := hashLen (x , tableBits , hashShortBytes )
275
- prevHashL := hash7 (x , tableBits )
275
+ prevHashL := hashLen (x , tableBits , hashLongBytes )
276
276
e .table [prevHashS ] = tableEntry {offset : o }
277
277
eLong := & e .bTable [prevHashL ]
278
278
eLong .Cur , eLong .Prev = tableEntry {offset : o }, eLong .Cur
0 commit comments