cyb70289 commented on code in PR #14442:
URL: https://github.com/apache/arrow/pull/14442#discussion_r998872925
##########
go/arrow/bitutil/bitmaps.go:
##########
@@ -390,15 +396,26 @@ func CopyBitmap(src []byte, srcOffset, length int, dst
[]byte, dstOffset int) {
rdr := NewBitmapWordReader(src, srcOffset, length)
wr := NewBitmapWordWriter(dst, dstOffset, length)
+ var modify func(in uint64) uint64
+ switch mode {
+ case transferCopy:
+ modify = func(in uint64) uint64 { return in }
+ case transferInvert:
+ modify = func(in uint64) uint64 { return ^in }
+ }
+
nwords := rdr.Words()
for nwords > 0 {
nwords--
- wr.PutNextWord(rdr.NextWord())
+ wr.PutNextWord(modify(rdr.NextWord()))
Review Comment:
Nit: since we still have to check `mode` explicitly in later code, looks `if
else` is simpler here?
--
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]