pitrou commented on code in PR #45869: URL: https://github.com/apache/arrow/pull/45869#discussion_r2154134575
########## 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: We could easily slice the input buffer if both offsets are equal modulo 8. It would avoid copying in slightly more cases. -- 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