| 56 | } |
| 57 | |
| 58 | Result<std::shared_ptr<Buffer>> BitmapAllButOne(MemoryPool* pool, int64_t length, |
| 59 | int64_t straggler_pos, bool value) { |
| 60 | if (straggler_pos < 0 || straggler_pos >= length) { |
| 61 | return Status::Invalid("invalid straggler_pos ", straggler_pos); |
| 62 | } |
| 63 | |
| 64 | ARROW_ASSIGN_OR_RAISE(auto buffer, |
| 65 | AllocateBuffer(bit_util::BytesForBits(length), pool)); |
| 66 | |
| 67 | auto bitmap_data = buffer->mutable_data(); |
| 68 | bit_util::SetBitsTo(bitmap_data, 0, length, value); |
| 69 | bit_util::SetBitTo(bitmap_data, straggler_pos, !value); |
| 70 | return buffer; |
| 71 | } |
| 72 | |
| 73 | } // namespace internal |
| 74 | } // namespace arrow |
no test coverage detected