@@ -113,7 +113,6 @@ type compressor struct {
113
113
// deflate state
114
114
length int
115
115
offset int
116
- hash uint32
117
116
maxInsertIndex int
118
117
err error
119
118
@@ -222,7 +221,6 @@ func (d *compressor) fillWindow(b []byte) {
222
221
// Set the head of the hash chain to us.
223
222
* hh = uint32 (di + d .hashOffset )
224
223
}
225
- d .hash = newH
226
224
}
227
225
// Update window information.
228
226
d .windowEnd = n
@@ -377,7 +375,6 @@ func (d *compressor) initDeflate() {
377
375
d .offset = 0
378
376
d .byteAvailable = false
379
377
d .index = 0
380
- d .hash = 0
381
378
d .chainHead = - 1
382
379
d .bulkHasher = bulkHash4
383
380
}
@@ -388,9 +385,6 @@ func (d *compressor) deflate() {
388
385
}
389
386
390
387
d .maxInsertIndex = d .windowEnd - (minMatchLength - 1 )
391
- if d .index < d .maxInsertIndex {
392
- d .hash = hash4 (d .window [d .index : d .index + minMatchLength ])
393
- }
394
388
395
389
Loop:
396
390
for {
@@ -423,8 +417,8 @@ Loop:
423
417
}
424
418
if d .index < d .maxInsertIndex {
425
419
// Update the hash
426
- d . hash = hash4 (d .window [d .index : d .index + minMatchLength ])
427
- hh := & d .hashHead [d . hash & hashMask ]
420
+ hash : = hash4 (d .window [d .index : d .index + minMatchLength ])
421
+ hh := & d .hashHead [hash & hashMask ]
428
422
d .chainHead = int (* hh )
429
423
d .hashPrev [d .index & windowMask ] = uint32 (d .chainHead )
430
424
* hh = uint32 (d .index + d .hashOffset )
@@ -469,10 +463,10 @@ Loop:
469
463
index := d .index
470
464
for index ++ ; index < newIndex ; index ++ {
471
465
if index < d .maxInsertIndex {
472
- d . hash = hash4 (d .window [index : index + minMatchLength ])
466
+ hash : = hash4 (d .window [index : index + minMatchLength ])
473
467
// Get previous value with the same hash.
474
468
// Our chain should point to the previous value.
475
- hh := & d .hashHead [d . hash & hashMask ]
469
+ hh := & d .hashHead [hash & hashMask ]
476
470
d .hashPrev [index & windowMask ] = * hh
477
471
// Set the head of the hash chain to us.
478
472
* hh = uint32 (index + d .hashOffset )
@@ -488,9 +482,6 @@ Loop:
488
482
// For matches this long, we don't bother inserting each individual
489
483
// item into the table.
490
484
d .index += d .length
491
- if d .index < d .maxInsertIndex {
492
- d .hash = hash4 (d .window [d .index : d .index + minMatchLength ])
493
- }
494
485
}
495
486
if len (d .tokens ) == maxFlateBlockTokens {
496
487
// The block includes the current character
@@ -634,7 +625,6 @@ func (d *compressor) reset(w io.Writer) {
634
625
d .tokens = d .tokens [:0 ]
635
626
d .length = minMatchLength - 1
636
627
d .offset = 0
637
- d .hash = 0
638
628
d .maxInsertIndex = 0
639
629
}
640
630
}
0 commit comments