diff options
Diffstat (limited to 'transform/chain.go')
-rw-r--r-- | transform/chain.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/transform/chain.go b/transform/chain.go index f9c99a04a..f71de94c8 100644 --- a/transform/chain.go +++ b/transform/chain.go @@ -65,6 +65,10 @@ func (ft fromToBuffer) Content() []byte { } func (c *chain) Apply(w io.Writer, r io.Reader, p []byte) error { + if len(*c) == 0 { + _, err := io.Copy(w, r) + return err + } b1 := bp.GetBuffer() defer bp.PutBuffer(b1) @@ -73,11 +77,6 @@ func (c *chain) Apply(w io.Writer, r io.Reader, p []byte) error { return err } - if len(*c) == 0 { - _, err := b1.WriteTo(w) - return err - } - b2 := bp.GetBuffer() defer bp.PutBuffer(b2) |