aboutsummaryrefslogtreecommitdiff
path: root/internal/compress/flate/deflate.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-05 21:17:08 +0800
committerGravatar Runxi Yu2026-03-05 21:17:08 +0800
commit77d651d2fcef14a55d21649435bb02836fbc3415 (patch)
tree36663447db71560f908bf43c97b0ad8ca9c1bbf7 /internal/compress/flate/deflate.go
parentinternal/compress/zlib: Check errors properly and prettify (diff)
signatureNo signature
*: Prettify
Diffstat (limited to 'internal/compress/flate/deflate.go')
-rw-r--r--internal/compress/flate/deflate.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/compress/flate/deflate.go b/internal/compress/flate/deflate.go
index ac4a2344..d8a1ff2a 100644
--- a/internal/compress/flate/deflate.go
+++ b/internal/compress/flate/deflate.go
@@ -132,7 +132,7 @@ func (d *compressor) fillDeflate(b []byte) int {
s := d.state
if s.index >= 2*windowSize-(minMatchLength+maxMatchLength) {
// shift the window by windowSize
- //copy(d.window[:], d.window[windowSize:2*windowSize])
+ // copy(d.window[:], d.window[windowSize:2*windowSize])
*(*[windowSize]byte)(d.window) = *(*[windowSize]byte)(d.window[windowSize:])
s.index -= windowSize
d.windowEnd -= windowSize
@@ -176,7 +176,7 @@ func (d *compressor) writeBlock(tok *tokens, index int, eof bool) error {
window = d.window[d.blockStart:index]
}
d.blockStart = index
- //d.w.writeBlock(tok, eof, window)
+ // d.w.writeBlock(tok, eof, window)
d.w.writeBlockDynamic(tok, eof, window, d.sync)
return d.w.err
}
@@ -325,7 +325,7 @@ func (d *compressor) findMatch(pos int, prevHead int, lookahead int) (length, of
// Calculate gain. Estimate
newGain := d.h.bitLengthRaw(wPos[:n]) - int(offsetExtraBits[offsetCode(uint32(pos-i))]) - baseCost - int(lengthExtraBits[lengthCodes[(n-3)&255]])
- //fmt.Println("gain:", newGain, "prev:", cGain, "raw:", d.h.bitLengthRaw(wPos[:n]), "this-len:", n, "prev-len:", length)
+ // fmt.Println("gain:", newGain, "prev:", cGain, "raw:", d.h.bitLengthRaw(wPos[:n]), "this-len:", n, "prev-len:", length)
if newGain > cGain {
length = n
offset = pos - i