diff --git a/cpp/src/arrow/array/util.cc b/cpp/src/arrow/array/util.cc index 38aa3d0e4d4be..7f00d4a3fe44c 100644 --- a/cpp/src/arrow/array/util.cc +++ b/cpp/src/arrow/array/util.cc @@ -916,18 +916,17 @@ Result> MakeEmptyArray(std::shared_ptr type, return builder->Finish(); } -Result> MakeMaskArray(const std::vector &indices, int64_t length, - MemoryPool* memory_pool) { +Result> MakeMaskArray(const std::vector& indices, + int64_t length, MemoryPool* memory_pool) { BooleanBuilder builder(memory_pool); RETURN_NOT_OK(builder.Resize(length)); auto i = indices.begin(); - for(int64_t builder_i = 0; builder_i < length; builder_i++) { + for (int64_t builder_i = 0; builder_i < length; builder_i++) { if (builder_i == *i) { builder.UnsafeAppend(true); i++; - } - else { + } else { builder.UnsafeAppend(false); } } diff --git a/cpp/src/arrow/array/util.h b/cpp/src/arrow/array/util.h index 0f01ba673e256..90f92d096d7c7 100644 --- a/cpp/src/arrow/array/util.h +++ b/cpp/src/arrow/array/util.h @@ -69,7 +69,6 @@ ARROW_EXPORT Result> MakeEmptyArray(std::shared_ptr type, MemoryPool* pool = default_memory_pool()); - /// \brief Create an Array representing a boolean mask /// /// The mask will have all elements set to false except for those @@ -80,8 +79,9 @@ Result> MakeEmptyArray(std::shared_ptr type, /// \param[in] pool the memory pool to allocate memory from /// \return the resulting Array ARROW_EXPORT -Result> MakeMaskArray(const std::vector &indices, int64_t length, - MemoryPool* memory_pool = default_memory_pool()); +Result> MakeMaskArray( + const std::vector& indices, int64_t length, + MemoryPool* memory_pool = default_memory_pool()); /// @} namespace internal {