Skip to content

Commit b83a94a

Browse files
committed
buffer: do not allocate background buffer until it's needed
1 parent c81b5c7 commit b83a94a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

buffer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ type buffer struct {
3636
// newBuffer allocates and returns a new buffer.
3737
func newBuffer(nc net.Conn) buffer {
3838
fg := make([]byte, defaultBufSize)
39-
bg := make([]byte, defaultBufSize)
4039
return buffer{
4140
buf: fg,
4241
nc: nc,
43-
dbuf: [2][]byte{fg, bg},
42+
dbuf: [2][]byte{fg, nil},
4443
}
4544
}
4645

0 commit comments

Comments
 (0)