Skip to content

Commit

Permalink
add a comment explaining backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
rathann committed Oct 28, 2020
1 parent b736c51 commit 25e050d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lz4.go
Expand Up @@ -16,6 +16,8 @@ type Lz4 struct {
// Compress reads in, compresses it, and writes it to out.
func (lz *Lz4) Compress(in io.Reader, out io.Writer) error {
w := lz4.NewWriter(out)
// TODO archiver v4: use proper lz4.Fast
// bitshifting for backwards compatibility with lz4/v3
options := []lz4.Option{
lz4.CompressionLevelOption(lz4.CompressionLevel(1 << (8 + lz.CompressionLevel))),
}
Expand Down
2 changes: 2 additions & 0 deletions tarlz4.go
Expand Up @@ -84,6 +84,8 @@ func (tlz4 *TarLz4) wrapWriter() {
var lz4w *lz4.Writer
tlz4.Tar.writerWrapFn = func(w io.Writer) (io.Writer, error) {
lz4w = lz4.NewWriter(w)
// TODO archiver v4: use proper lz4.Fast
// bitshifting for backwards compatibility with lz4/v3
options := []lz4.Option{
lz4.CompressionLevelOption(lz4.CompressionLevel(1 << (8 + tlz4.CompressionLevel))),
}
Expand Down

0 comments on commit 25e050d

Please sign in to comment.