When the stream channel has closed it drops all of its pending reads. It does this by calling 'removeAll()' on its CircularBuffer. The buffers underlying storage is emptied and then a nil is appended (internally CircularBuffer is never empty) which triggers an allocation.
Motivation:
When the stream channel has closed it drops all of its pending reads. It does this by calling 'removeAll()' on its CircularBuffer. The buffers underlying storage is emptied and then a
nil
is appended (internally CircularBuffer is never empty) which triggers an allocation.Modifications:
Result:
Fewer allocations