Skip to content

Commit

Permalink
lint cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Oct 16, 2024
1 parent dc836d1 commit c499f26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions cpp/src/arrow/array/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -916,18 +916,17 @@ Result<std::shared_ptr<Array>> MakeEmptyArray(std::shared_ptr<DataType> type,
return builder->Finish();
}

Result<std::shared_ptr<Array>> MakeMaskArray(const std::vector<int64_t> &indices, int64_t length,
MemoryPool* memory_pool) {
Result<std::shared_ptr<Array>> MakeMaskArray(const std::vector<int64_t>& 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);
}
}
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/array/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ ARROW_EXPORT
Result<std::shared_ptr<Array>> MakeEmptyArray(std::shared_ptr<DataType> 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
Expand All @@ -80,8 +79,9 @@ Result<std::shared_ptr<Array>> MakeEmptyArray(std::shared_ptr<DataType> type,
/// \param[in] pool the memory pool to allocate memory from
/// \return the resulting Array
ARROW_EXPORT
Result<std::shared_ptr<Array>> MakeMaskArray(const std::vector<int64_t> &indices, int64_t length,
MemoryPool* memory_pool = default_memory_pool());
Result<std::shared_ptr<Array>> MakeMaskArray(
const std::vector<int64_t>& indices, int64_t length,
MemoryPool* memory_pool = default_memory_pool());
/// @}

namespace internal {
Expand Down

0 comments on commit c499f26

Please sign in to comment.