Files
swift-nio/Sources
Kamil Borzym 62fd8729d3 ByteBuffer.clear should reset the ByteBuffer._slice. (#1212)
Motivation:

ByteBuffer.clear doesn't reset the ByteBuffer._slice. Imagine having a byte buffer slice (ByteBuffer.getSlice). Calling ByteBuffer.clear on the slice will reset the reader and writer, but the ByteBuffer.capacity will return the old slice size, not the full storage capacity. After this change ByteBuffer.clear will also reset the ByteBuffer._slice to regain the whole ByteBuffer._storage.

Modifications:

Just setting the full storage slice in the ByteBuffer.clear method.

Result:

After that change ByteBuffer.clear will reset byte buffer slice to full capacity of underlying storage.
2019-10-31 09:05:51 +01:00
..
2019-02-26 14:15:56 +00:00
2019-10-16 22:06:55 -07:00