pitrou commented on code in PR #45869: URL: https://github.com/apache/arrow/pull/45869#discussion_r2154138772
########## cpp/src/arrow/util/bitmap_ops.cc: ########## @@ -394,6 +394,31 @@ Result<std::shared_ptr<Buffer>> BitmapOp(MemoryPool* pool, const uint8_t* left, } // namespace +Result<std::shared_ptr<Buffer>> OptionalBitmapAnd(MemoryPool* pool, + const std::shared_ptr<Buffer>& left, + int64_t left_offset, + const std::shared_ptr<Buffer>& right, + int64_t right_offset, int64_t length, + int64_t out_offset) { + if (left == nullptr && right == nullptr) { + return nullptr; + } else if (left == nullptr) { + if (right_offset == out_offset) { + return right; + } Review Comment: It could be a dedicated function `ViewOrCopyBitmap` by the way. Search through the source code would probably find other places where such a function could be useful. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org