summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/alexcesaro/quotedprintable.v3/pool_go12.go
blob: d335b4ab57aa8f28e155b2a5280cd9e90bbb22ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// +build !go1.3

package quotedprintable

import "bytes"

var ch = make(chan *bytes.Buffer, 32)

func getBuffer() *bytes.Buffer {
	select {
	case buf := <-ch:
		return buf
	default:
	}
	return new(bytes.Buffer)
}

func putBuffer(buf *bytes.Buffer) {
	buf.Reset()
	select {
	case ch <- buf:
	default:
	}
}