@@ -92,7 +92,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
9292 var t int32
9393 for {
9494 nextHashS := hashLen (cv , tableBits , hashShortBytes )
95- nextHashL := hash7 (cv , tableBits )
95+ nextHashL := hashLen (cv , tableBits , hashLongBytes )
9696
9797 s = nextS
9898 nextS = s + doEvery + (s - nextEmit )>> skipLog
@@ -109,7 +109,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
109109 eLong .Cur , eLong .Prev = entry , eLong .Cur
110110
111111 nextHashS = hashLen (next , tableBits , hashShortBytes )
112- nextHashL = hash7 (next , tableBits )
112+ nextHashL = hashLen (next , tableBits , hashLongBytes )
113113
114114 t = lCandidate .Cur .offset - e .cur
115115 if s - t < maxMatchOffset {
@@ -196,7 +196,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
196196 // The skipped bytes are tested in Extend backwards,
197197 // and still picked up as part of the match if they do.
198198 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
200200 t2 := eLong - e .cur - l + skipBeginning
201201 s2 := s + skipBeginning
202202 off := s2 - t2
@@ -241,13 +241,13 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
241241 cv := loadLE64 (src , i )
242242 t := tableEntry {offset : i + e .cur }
243243 e .table [hashLen (cv , tableBits , hashShortBytes )] = t
244- eLong := & e .bTable [hash7 (cv , tableBits )]
244+ eLong := & e .bTable [hashLen (cv , tableBits , hashLongBytes )]
245245 eLong .Cur , eLong .Prev = t , eLong .Cur
246246
247247 // Do an long at i+1
248248 cv >>= 8
249249 t = tableEntry {offset : t .offset + 1 }
250- eLong = & e .bTable [hash7 (cv , tableBits )]
250+ eLong = & e .bTable [hashLen (cv , tableBits , hashLongBytes )]
251251 eLong .Cur , eLong .Prev = t , eLong .Cur
252252
253253 // We only have enough bits for a short entry at i+2
@@ -261,7 +261,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
261261 cv := loadLE64 (src , i )
262262 t := tableEntry {offset : i + e .cur }
263263 t2 := tableEntry {offset : t .offset + 1 }
264- eLong := & e .bTable [hash7 (cv , tableBits )]
264+ eLong := & e .bTable [hashLen (cv , tableBits , hashLongBytes )]
265265 eLong .Cur , eLong .Prev = t , eLong .Cur
266266 e .table [hashLen (cv >> 8 , tableBits , hashShortBytes )] = t2
267267 }
@@ -272,7 +272,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) {
272272 x := loadLE64 (src , s - 1 )
273273 o := e .cur + s - 1
274274 prevHashS := hashLen (x , tableBits , hashShortBytes )
275- prevHashL := hash7 (x , tableBits )
275+ prevHashL := hashLen (x , tableBits , hashLongBytes )
276276 e .table [prevHashS ] = tableEntry {offset : o }
277277 eLong := & e .bTable [prevHashL ]
278278 eLong .Cur , eLong .Prev = tableEntry {offset : o }, eLong .Cur
0 commit comments