zeroshade commented on code in PR #1144:
URL: https://github.com/apache/arrow-go/pull/1144#discussion_r3760532566
##########
parquet/internal/encoding/types.go:
##########
@@ -340,13 +340,21 @@ func (b *BufferWriter) SetOffset(offset int) {
b.offset = offset
}
+func (b *BufferWriter) ensureOffset() {
Review Comment:
Could we apply the same normalization in `Cap()` and cover it in
`TestBufferWriterOffset`? With a fresh writer followed by `SetOffset(1024)`,
`Cap()` currently returns `-1024`; after calling `Len()` or `Bytes()`, it
returns `0` because those methods resize the prefix. That leaves capacity
dependent on call order and permits a negative capacity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]