disq commented on code in PR #34631:
URL: https://github.com/apache/arrow/pull/34631#discussion_r1160106920
##########
go/parquet/pqarrow/file_reader.go:
##########
@@ -356,11 +356,9 @@ func (fr *FileReader) ReadRowGroups(ctx context.Context,
indices, rowGroups []in
// pass pairs of reader and column index to the channel for the
// goroutines to read the data
- for idx, r := range readers {
- defer func(r *ColumnReader) {
- r.Release()
- }(r)
- ch <- readerInfo{r, idx}
+ for idx := range readers {
+ defer readers[idx].Release()
Review Comment:
Cleaned up a little here, shorter and easier to understand, without a
shadowing-closure for the defer, and no confusion as of to the value of `r`
w.r.t. `range`.
--
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]