From 5f995cb9a64bbedd69c53b5abf57389a63996f45 Mon Sep 17 00:00:00 2001 From: Alessandro Molina Date: Wed, 16 Oct 2024 22:26:01 +0000 Subject: [PATCH] lint cpp --- cpp/src/arrow/array/util.cc | 9 ++++----- cpp/src/arrow/array/util.h | 6 +++--- python/pyarrow/tests/test_array.py | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) 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 { diff --git a/python/pyarrow/tests/test_array.py b/python/pyarrow/tests/test_array.py index 1aa1ba8b75934..11c6eab317cd7 100644 --- a/python/pyarrow/tests/test_array.py +++ b/python/pyarrow/tests/test_array.py @@ -4207,4 +4207,4 @@ def test_non_cpu_array(): def test_mask_array(): expected = pa.array([False, False, True, False, True, False]) mask_array = pa.mask([2, 4], 6) - assert mask_array.equals(expected) \ No newline at end of file + assert mask_array.equals(expected)