grow ensures there's space for n more bytes. Hot path is inlined.
(n int)
| 160 | |
| 161 | // grow ensures there's space for n more bytes. Hot path is inlined. |
| 162 | func (b *ByteBuffer) grow(n int) { |
| 163 | if b.writerIndex+n <= len(b.data) { |
| 164 | return // Fast path - single comparison, easily inlined |
| 165 | } |
| 166 | b.growSlow(n) |
| 167 | } |
| 168 | |
| 169 | // growSlow handles the cold path when buffer expansion is needed. |
| 170 | // |
no test coverage detected