| 49 | using internal::CountSetBits; |
| 50 | |
| 51 | static inline void AdjustNonNullable(Type::type type_id, int64_t length, |
| 52 | std::vector<std::shared_ptr<Buffer>>* buffers, |
| 53 | int64_t* null_count) { |
| 54 | if (type_id == Type::NA) { |
| 55 | *null_count = length; |
| 56 | (*buffers)[0] = nullptr; |
| 57 | } else if (internal::may_have_validity_bitmap(type_id)) { |
| 58 | if (*null_count == 0) { |
| 59 | // In case there are no nulls, don't keep an allocated null bitmap around |
| 60 | (*buffers)[0] = nullptr; |
| 61 | } else if (*null_count == kUnknownNullCount && buffers->at(0) == nullptr) { |
| 62 | // Conversely, if no null bitmap is provided, set the null count to 0 |
| 63 | *null_count = 0; |
| 64 | } |
| 65 | } else { |
| 66 | *null_count = 0; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | namespace internal { |
| 71 |
no test coverage detected