File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -130,18 +130,18 @@ func (b *buffer) takeBuffer(length int) []byte {
130
130
// smaller than defaultBufSize
131
131
// Only one buffer (total) can be used at a time.
132
132
func (b * buffer ) takeSmallBuffer (length int ) []byte {
133
- if b .length == 0 {
134
- return b . buf [: length ]
133
+ if b .length > 0 {
134
+ return nil
135
135
}
136
- return nil
136
+ return b . buf [: length ]
137
137
}
138
138
139
139
// takeCompleteBuffer returns the complete existing buffer.
140
140
// This can be used if the necessary buffer size is unknown.
141
141
// Only one buffer (total) can be used at a time.
142
142
func (b * buffer ) takeCompleteBuffer () []byte {
143
- if b .length == 0 {
144
- return b . buf
143
+ if b .length > 0 {
144
+ return nil
145
145
}
146
- return nil
146
+ return b . buf
147
147
}
You can’t perform that action at this time.
0 commit comments