Skip to content

Commit 356e7f8

Browse files
authored
ARROW-17814: [C++] Fix style (#14218)
This is a follow-up of #14204. Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: David Li <[email protected]>
1 parent dfdd0ce commit 356e7f8

31 files changed

Lines changed: 64 additions & 92 deletions

‎cpp/src/arrow/compute/exec/asof_join_node.cc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,7 @@ class AsofJoinNode : public ExecNode {
10591059

10601060
std::vector<std::unique_ptr<KeyHasher>> key_hashers;
10611061
for (size_t i = 0; i < n_input; i++) {
1062-
key_hashers.push_back(
1063-
std::make_unique<KeyHasher>(indices_of_by_key[i]));
1062+
key_hashers.push_back(std::make_unique<KeyHasher>(indices_of_by_key[i]));
10641063
}
10651064
bool must_hash =
10661065
n_by > 1 ||

‎cpp/src/arrow/compute/exec/asof_join_node_test.cc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ void CheckRunOutput(const BatchesWithSchema& l_batches,
209209
const BatchesWithSchema& r1_batches,
210210
const BatchesWithSchema& exp_batches,
211211
const AsofJoinNodeOptions join_options) {
212-
auto exec_ctx =
213-
std::make_unique<ExecContext>(default_memory_pool(), nullptr);
212+
auto exec_ctx = std::make_unique<ExecContext>(default_memory_pool(), nullptr);
214213
ASSERT_OK_AND_ASSIGN(auto plan, ExecPlan::Make(exec_ctx.get()));
215214

216215
Declaration join{"asofjoin", join_options};

‎cpp/src/arrow/compute/exec/hash_join_benchmark.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class JoinBenchmark {
126126
stats_.num_probe_rows = settings.num_probe_batches * settings.batch_size;
127127

128128
ctx_ = std::make_unique<ExecContext>(default_memory_pool(),
129-
arrow::internal::GetCpuThreadPool());
129+
arrow::internal::GetCpuThreadPool());
130130

131131
schema_mgr_ = std::make_unique<HashJoinSchema>();
132132
Expression filter = literal(true);

‎cpp/src/arrow/compute/exec/hash_join_node.cc‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,7 @@ struct BloomFilterPushdownContext {
579579
arrow::internal::BitmapAnd(bv.data(), 0, selected.data(), 0, key_batch.length, 0,
580580
selected.data());
581581
}
582-
auto selected_buffer =
583-
std::make_unique<Buffer>(selected.data(), bit_vector_bytes);
582+
auto selected_buffer = std::make_unique<Buffer>(selected.data(), bit_vector_bytes);
584583
ArrayData selected_arraydata(boolean(), batch.length,
585584
{nullptr, std::move(selected_buffer)});
586585
Datum selected_datum(selected_arraydata);
@@ -715,8 +714,7 @@ class HashJoinNode : public ExecNode {
715714
// Number of input exec nodes must be 2
716715
RETURN_NOT_OK(ValidateExecNodeInputs(plan, inputs, 2, "HashJoinNode"));
717716

718-
std::unique_ptr<HashJoinSchema> schema_mgr =
719-
std::make_unique<HashJoinSchema>();
717+
std::unique_ptr<HashJoinSchema> schema_mgr = std::make_unique<HashJoinSchema>();
720718

721719
const auto& join_options = checked_cast<const HashJoinNodeOptions&>(options);
722720
RETURN_NOT_OK(ValidateHashJoinNodeOptions(join_options));

‎cpp/src/arrow/compute/exec/hash_join_node_test.cc‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,8 +1734,7 @@ TEST(HashJoin, DictNegative) {
17341734
ExecBatch::Make({i == 2 ? datumSecondB : datumSecondA,
17351735
i == 3 ? datumSecondB : datumSecondA}));
17361736

1737-
auto exec_ctx =
1738-
std::make_unique<ExecContext>(default_memory_pool(), nullptr);
1737+
auto exec_ctx = std::make_unique<ExecContext>(default_memory_pool(), nullptr);
17391738
ASSERT_OK_AND_ASSIGN(auto plan, ExecPlan::Make(exec_ctx.get()));
17401739
ASSERT_OK_AND_ASSIGN(
17411740
ExecNode * l_source,
@@ -1911,8 +1910,7 @@ TEST(HashJoin, ExtensionTypesHashJoin) {
19111910
}
19121911

19131912
TEST(HashJoin, CheckHashJoinNodeOptionsValidation) {
1914-
auto exec_ctx =
1915-
std::make_unique<ExecContext>(default_memory_pool(), nullptr);
1913+
auto exec_ctx = std::make_unique<ExecContext>(default_memory_pool(), nullptr);
19161914
ASSERT_OK_AND_ASSIGN(auto plan, ExecPlan::Make(exec_ctx.get()));
19171915

19181916
BatchesWithSchema input_left;

‎cpp/src/arrow/compute/kernels/aggregate_basic.cc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ struct CountImpl : public ScalarAggregator {
120120

121121
Result<std::unique_ptr<KernelState>> CountInit(KernelContext*,
122122
const KernelInitArgs& args) {
123-
return std::make_unique<CountImpl>(
124-
static_cast<const CountOptions&>(*args.options));
123+
return std::make_unique<CountImpl>(static_cast<const CountOptions&>(*args.options));
125124
}
126125

127126
// ----------------------------------------------------------------------

‎cpp/src/arrow/compute/kernels/codegen_internal.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ struct KernelStateFromFunctionOptions : public KernelState {
100100
static Result<std::unique_ptr<KernelState>> Init(KernelContext* ctx,
101101
const KernelInitArgs& args) {
102102
if (auto options = static_cast<const OptionsType*>(args.options)) {
103-
return std::make_unique<KernelStateFromFunctionOptions>(ctx,
104-
*options);
103+
return std::make_unique<KernelStateFromFunctionOptions>(ctx, *options);
105104
}
106105

107106
return Status::Invalid(

‎cpp/src/arrow/compute/kernels/scalar_string_ascii.cc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,8 +1308,7 @@ struct RegexSubstringMatcher {
13081308

13091309
static Result<std::unique_ptr<RegexSubstringMatcher>> Make(
13101310
const MatchSubstringOptions& options, bool is_utf8 = true, bool literal = false) {
1311-
auto matcher =
1312-
std::make_unique<RegexSubstringMatcher>(options, is_utf8, literal);
1311+
auto matcher = std::make_unique<RegexSubstringMatcher>(options, is_utf8, literal);
13131312
RETURN_NOT_OK(RegexStatus(matcher->regex_match_));
13141313
return std::move(matcher);
13151314
}

‎cpp/src/arrow/compute/kernels/vector_hash.cc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ template <typename Type, typename Action>
524524
Result<std::unique_ptr<HashKernel>> HashInitImpl(KernelContext* ctx,
525525
const KernelInitArgs& args) {
526526
using HashKernelType = typename HashKernelTraits<Type, Action>::HashKernel;
527-
auto result = std::make_unique<HashKernelType>(
528-
args.inputs[0].GetSharedPtr(), args.options, ctx->memory_pool());
527+
auto result = std::make_unique<HashKernelType>(args.inputs[0].GetSharedPtr(),
528+
args.options, ctx->memory_pool());
529529
RETURN_NOT_OK(result->Reset());
530530
return std::move(result);
531531
}
@@ -614,8 +614,8 @@ Result<std::unique_ptr<KernelState>> DictionaryHashInit(KernelContext* ctx,
614614
break;
615615
}
616616
RETURN_NOT_OK(indices_hasher);
617-
return std::make_unique<DictionaryHashKernel>(
618-
std::move(indices_hasher.ValueOrDie()), dict_type.value_type());
617+
return std::make_unique<DictionaryHashKernel>(std::move(indices_hasher.ValueOrDie()),
618+
dict_type.value_type());
619619
}
620620

621621
Status HashExec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {

‎cpp/src/arrow/compute/row/grouper.cc‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,34 +57,30 @@ struct GrouperImpl : Grouper {
5757
std::shared_ptr<DataType> key = key_types[i].GetSharedPtr();
5858

5959
if (key->id() == Type::BOOL) {
60-
impl->encoders_[i] =
61-
std::make_unique<internal::BooleanKeyEncoder>();
60+
impl->encoders_[i] = std::make_unique<internal::BooleanKeyEncoder>();
6261
continue;
6362
}
6463

6564
if (key->id() == Type::DICTIONARY) {
6665
impl->encoders_[i] =
67-
std::make_unique<internal::DictionaryKeyEncoder>(
68-
key, ctx->memory_pool());
66+
std::make_unique<internal::DictionaryKeyEncoder>(key, ctx->memory_pool());
6967
continue;
7068
}
7169

7270
if (is_fixed_width(key->id())) {
73-
impl->encoders_[i] =
74-
std::make_unique<internal::FixedWidthKeyEncoder>(key);
71+
impl->encoders_[i] = std::make_unique<internal::FixedWidthKeyEncoder>(key);
7572
continue;
7673
}
7774

7875
if (is_binary_like(key->id())) {
7976
impl->encoders_[i] =
80-
std::make_unique<internal::VarLengthKeyEncoder<BinaryType>>(
81-
key);
77+
std::make_unique<internal::VarLengthKeyEncoder<BinaryType>>(key);
8278
continue;
8379
}
8480

8581
if (is_large_binary_like(key->id())) {
86-
impl->encoders_[i] = std::make_unique<
87-
internal::VarLengthKeyEncoder<LargeBinaryType>>(key);
82+
impl->encoders_[i] =
83+
std::make_unique<internal::VarLengthKeyEncoder<LargeBinaryType>>(key);
8884
continue;
8985
}
9086

0 commit comments

Comments
 (0)