Skip to content

Commit

Permalink
feat: if we don't compress we don't need the dict (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel authored Nov 20, 2023
1 parent 9fb591e commit 3aa2559
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion std/compress/lzss/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ func NewCompressor(dict []byte, level Level) (*Compressor, error) {
dictData: dict,
}
c.buf.Grow(maxInputSize)
c.dictIndex = suffixarray.New(c.dictData, c.dictSa[:len(c.dictData)])
if level != NoCompression {
// if we don't compress we don't need the dict.
c.dictIndex = suffixarray.New(c.dictData, c.dictSa[:len(c.dictData)])
}
c.level = level
return c, nil
}
Expand Down

0 comments on commit 3aa2559

Please sign in to comment.