@@ -434,8 +434,8 @@ func (w *huffmanBitWriter) writeOutBits() {
434434 w .nbits -= 48
435435 n := w .nbytes
436436
437- // We over-write , but faster...
438- le .Store64 (w .bytes [n :] , bits )
437+ // We overwrite , but faster...
438+ le .Store64 (w .bytes [:], n , bits )
439439 n += 6
440440
441441 if n >= bufferFlushSize {
@@ -851,8 +851,7 @@ func (w *huffmanBitWriter) writeTokens(tokens []token, leCodes, oeCodes []hcode)
851851 bits |= c .code64 () << (nbits & 63 )
852852 nbits += c .len ()
853853 if nbits >= 48 {
854- le .Store64 (w .bytes [nbytes :], bits )
855- //*(*uint64)(unsafe.Pointer(&w.bytes[nbytes])) = bits
854+ le .Store64 (w .bytes [:], nbytes , bits )
856855 bits >>= 48
857856 nbits -= 48
858857 nbytes += 6
@@ -879,8 +878,7 @@ func (w *huffmanBitWriter) writeTokens(tokens []token, leCodes, oeCodes []hcode)
879878 bits |= c .code64 () << (nbits & 63 )
880879 nbits += c .len ()
881880 if nbits >= 48 {
882- le .Store64 (w .bytes [nbytes :], bits )
883- //*(*uint64)(unsafe.Pointer(&w.bytes[nbytes])) = bits
881+ le .Store64 (w .bytes [:], nbytes , bits )
884882 bits >>= 48
885883 nbits -= 48
886884 nbytes += 6
@@ -902,8 +900,7 @@ func (w *huffmanBitWriter) writeTokens(tokens []token, leCodes, oeCodes []hcode)
902900 bits |= uint64 (extraLength ) << (nbits & 63 )
903901 nbits += extraLengthBits
904902 if nbits >= 48 {
905- le .Store64 (w .bytes [nbytes :], bits )
906- //*(*uint64)(unsafe.Pointer(&w.bytes[nbytes])) = bits
903+ le .Store64 (w .bytes [:], nbytes , bits )
907904 bits >>= 48
908905 nbits -= 48
909906 nbytes += 6
@@ -928,8 +925,7 @@ func (w *huffmanBitWriter) writeTokens(tokens []token, leCodes, oeCodes []hcode)
928925 bits |= c .code64 () << (nbits & 63 )
929926 nbits += c .len ()
930927 if nbits >= 48 {
931- le .Store64 (w .bytes [nbytes :], bits )
932- //*(*uint64)(unsafe.Pointer(&w.bytes[nbytes])) = bits
928+ le .Store64 (w .bytes [:], nbytes , bits )
933929 bits >>= 48
934930 nbits -= 48
935931 nbytes += 6
@@ -950,8 +946,7 @@ func (w *huffmanBitWriter) writeTokens(tokens []token, leCodes, oeCodes []hcode)
950946 bits |= uint64 ((offset - (offsetComb >> 8 ))& matchOffsetOnlyMask ) << (nbits & 63 )
951947 nbits += uint8 (offsetComb )
952948 if nbits >= 48 {
953- le .Store64 (w .bytes [nbytes :], bits )
954- //*(*uint64)(unsafe.Pointer(&w.bytes[nbytes])) = bits
949+ le .Store64 (w .bytes [:], nbytes , bits )
955950 bits >>= 48
956951 nbits -= 48
957952 nbytes += 6
@@ -1104,7 +1099,7 @@ func (w *huffmanBitWriter) writeBlockHuff(eof bool, input []byte, sync bool) {
11041099 // We must have at least 48 bits free.
11051100 if nbits >= 8 {
11061101 n := nbits >> 3
1107- le .Store64 (w .bytes [nbytes :] , bits )
1102+ le .Store64 (w .bytes [:], nbytes , bits )
11081103 bits >>= (n * 8 ) & 63
11091104 nbits -= n * 8
11101105 nbytes += n
@@ -1133,8 +1128,7 @@ func (w *huffmanBitWriter) writeBlockHuff(eof bool, input []byte, sync bool) {
11331128 // Remaining...
11341129 for _ , t := range input {
11351130 if nbits >= 48 {
1136- le .Store64 (w .bytes [nbytes :], bits )
1137- //*(*uint64)(unsafe.Pointer(&w.bytes[nbytes])) = bits
1131+ le .Store64 (w .bytes [:], nbytes , bits )
11381132 bits >>= 48
11391133 nbits -= 48
11401134 nbytes += 6
0 commit comments