From 25e050dbb4e3c591402916201098241bb661a2f7 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Wed, 28 Oct 2020 09:06:03 +0100 Subject: [PATCH] add a comment explaining backwards compatibility --- lz4.go | 2 ++ tarlz4.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lz4.go b/lz4.go index 68fecaa7..3d6b0a21 100644 --- a/lz4.go +++ b/lz4.go @@ -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))), } diff --git a/tarlz4.go b/tarlz4.go index 1bad3e7a..42cbc90b 100644 --- a/tarlz4.go +++ b/tarlz4.go @@ -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))), }