diff options
author | spf13 <[email protected]> | 2015-01-30 11:39:06 -0800 |
---|---|---|
committer | spf13 <[email protected]> | 2015-01-30 11:39:06 -0800 |
commit | 4828fee11daf2c989aa40061ccf6ba7b7c685364 (patch) | |
tree | a7ed2bb8cfcaa1003c3c73074fb0afac16db24c3 /transform | |
parent | 5441fc5dfc056a4e4dfd34ca16f0928e482b4c29 (diff) | |
download | hugo-4828fee11daf2c989aa40061ccf6ba7b7c685364.tar.gz hugo-4828fee11daf2c989aa40061ccf6ba7b7c685364.zip |
transform chain using BBP
Diffstat (limited to 'transform')
-rw-r--r-- | transform/chain.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/transform/chain.go b/transform/chain.go index c673c5d6a..c6e56960c 100644 --- a/transform/chain.go +++ b/transform/chain.go @@ -1,8 +1,9 @@ package transform import ( - "bytes" "io" + + bp "github.com/spf13/hugo/bufferpool" ) type trans func([]byte) []byte @@ -20,8 +21,9 @@ func NewEmptyTransforms() []link { } func (c *chain) Apply(w io.Writer, r io.Reader) (err error) { + buffer := bp.GetBuffer() + defer bp.PutBuffer(buffer) - buffer := new(bytes.Buffer) buffer.ReadFrom(r) b := buffer.Bytes() for _, tr := range *c { |