Skip to content

Commit

Permalink
删除用不到的代码
Browse files Browse the repository at this point in the history
  • Loading branch information
guonaihong committed May 17, 2024
1 parent 5638972 commit 837e5e6
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions deflate/compression_encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,13 @@ func newCompressContextTakeover(w io.WriteCloser, level int, bit uint8) (*flate.
fw, _ = p.Get().(*flate.Writer)
if fw == nil {
fw, _ = flate.NewWriterWindow(w, 1<<bit)
} else {
fw.Reset(w)
}
} else {

p = &flateWriterPools[level-minCompressionLevel]
fw, _ = p.Get().(*flate.Writer)
if fw == nil {
fw, _ = flate.NewWriter(w, level)
} else {
fw.Reset(w)
}
}

Expand All @@ -75,7 +71,6 @@ func newCompressContextTakeover(w io.WriteCloser, level int, bit uint8) (*flate.

type CompressContextTakeover struct {
dict historyDict
bit uint8
}

type wrapBuffer struct {
Expand All @@ -92,15 +87,13 @@ func NewCompressContextTakeover(bit uint8) (en *CompressContextTakeover, err err
size := 1 << bit
en = &CompressContextTakeover{}
en.dict.InitHistoryDict(size)
en.bit = bit
return en, nil
}

func (e *CompressContextTakeover) Compress(payload *[]byte) (encodePayload *[]byte, err error) {
func (e *CompressContextTakeover) Compress(payload *[]byte, bit uint8) (encodePayload *[]byte, err error) {

encodeBuf := bytespool.GetBytes(len(*payload) + enum.MaxFrameHeaderSize)

bit := uint8(0)
var dict []byte
if e != nil {
bit = e.bit

Check failure on line 99 in deflate/compression_encode.go

View workflow job for this annotation

GitHub Actions / Go 1.20 sample

e.bit undefined (type *CompressContextTakeover has no field or method bit)
Expand Down

0 comments on commit 837e5e6

Please sign in to comment.