zeroshade commented on code in PR #587:
URL: https://github.com/apache/arrow-go/pull/587#discussion_r2581807433
##########
arrow/array/encoded.go:
##########
@@ -209,18 +209,31 @@ func (r *RunEndEncoded) ValueStr(i int) string {
}
func (r *RunEndEncoded) String() string {
+ physOffset := r.GetPhysicalOffset()
+ physLength := r.GetPhysicalLength()
+
var buf bytes.Buffer
buf.WriteByte('[')
- for i := 0; i < r.ends.Len(); i++ {
- if i != 0 {
+ for i := physOffset; i < physOffset+physLength; i++ {
Review Comment:
we're not starting at 0, we're starting at `physOffset`.
We could do `i := range physLength` and then do `offset := i + physOffset`
inside the loop, but I felt that wasn't as obvious and easily missed as opposed
to explicitly going *from* `physOffset` *to* `physOffset + physLength`
--
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]