mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
transform chain using BBP
This commit is contained in:
parent
5441fc5dfc
commit
4828fee11d
1 changed files with 4 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue