Skip to content

Commit

Permalink
The compression level can be DefaultCompression, NoCompression, or an…
Browse files Browse the repository at this point in the history
…y integer value between BestSpeed and BestCompression inclusive
  • Loading branch information
rnishtala-sumo committed Nov 15, 2024
1 parent f198b52 commit 6bcb03a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/configcompression/compressiontype.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func (ct *TypeWithLevel) UnmarshalText(in []byte) error {

// Checks the validity of zlib/gzip/flate compression levels
func isValidLevel(level int) bool {
return level == zlib.BestSpeed ||
level == zlib.BestCompression ||
level == zlib.DefaultCompression ||
return level == zlib.DefaultCompression ||
level == zlib.HuffmanOnly ||
level == zlib.NoCompression
level == zlib.NoCompression ||
level == zlib.BestSpeed ||
(level >= zlib.BestSpeed && level <= zlib.BestCompression)
}

0 comments on commit 6bcb03a

Please sign in to comment.