diff --git a/src/Interpreters/Aggregator.cpp b/src/Interpreters/Aggregator.cpp index b0f8f26c8e9..90af4352b42 100644 --- a/src/Interpreters/Aggregator.cpp +++ b/src/Interpreters/Aggregator.cpp @@ -2316,7 +2316,7 @@ void Aggregator::destroyAllAggregateStates(AggregatedDataVariants & result) } -void Aggregator::setCancellationHook(const CancellationHook cancellation_hook) +void Aggregator::setCancellationHook(const CancellationHook & cancellation_hook) { isCancelled = cancellation_hook; } diff --git a/src/Interpreters/Aggregator.h b/src/Interpreters/Aggregator.h index 331d50672ab..2a1224b0b48 100644 --- a/src/Interpreters/Aggregator.h +++ b/src/Interpreters/Aggregator.h @@ -134,7 +134,7 @@ struct AggregationDataWithNullKeyTwoLevel : public Base { using Base::impls; - AggregationDataWithNullKeyTwoLevel() {} + AggregationDataWithNullKeyTwoLevel() = default; template explicit AggregationDataWithNullKeyTwoLevel(const Other & other) : Base(other) @@ -184,7 +184,7 @@ struct AggregationMethodOneNumber Data data; - AggregationMethodOneNumber() {} + AggregationMethodOneNumber() = default; template AggregationMethodOneNumber(const Other & other) : data(other.data) {} @@ -199,8 +199,8 @@ struct AggregationMethodOneNumber // Insert the key from the hash table into columns. static void insertKeyIntoColumns(const Key & key, MutableColumns & key_columns, const Sizes & /*key_sizes*/) { - auto key_holder = reinterpret_cast(&key); - auto column = static_cast(key_columns[0].get()); + const auto * key_holder = reinterpret_cast(&key); + auto * column = static_cast(key_columns[0].get()); column->insertRawData(key_holder); } }; @@ -216,7 +216,7 @@ struct AggregationMethodString Data data; - AggregationMethodString() {} + AggregationMethodString() = default; template AggregationMethodString(const Other & other) : data(other.data) {} @@ -242,7 +242,7 @@ struct AggregationMethodStringNoCache Data data; - AggregationMethodStringNoCache() {} + AggregationMethodStringNoCache() = default; template AggregationMethodStringNoCache(const Other & other) : data(other.data) {} @@ -268,7 +268,7 @@ struct AggregationMethodFixedString Data data; - AggregationMethodFixedString() {} + AggregationMethodFixedString() = default; template AggregationMethodFixedString(const Other & other) : data(other.data) {} @@ -293,7 +293,7 @@ struct AggregationMethodFixedStringNoCache Data data; - AggregationMethodFixedStringNoCache() {} + AggregationMethodFixedStringNoCache() = default; template AggregationMethodFixedStringNoCache(const Other & other) : data(other.data) {} @@ -334,7 +334,7 @@ struct AggregationMethodSingleLowCardinalityColumn : public SingleColumnMethod static void insertKeyIntoColumns(const Key & key, MutableColumns & key_columns_low_cardinality, const Sizes & /*key_sizes*/) { - auto col = assert_cast(key_columns_low_cardinality[0].get()); + auto * col = assert_cast(key_columns_low_cardinality[0].get()); if constexpr (std::is_same_v) { @@ -360,7 +360,7 @@ struct AggregationMethodKeysFixed Data data; - AggregationMethodKeysFixed() {} + AggregationMethodKeysFixed() = default; template AggregationMethodKeysFixed(const Other & other) : data(other.data) {} @@ -438,7 +438,7 @@ struct AggregationMethodSerialized Data data; - AggregationMethodSerialized() {} + AggregationMethodSerialized() = default; template AggregationMethodSerialized(const Other & other) : data(other.data) {} @@ -449,7 +449,7 @@ struct AggregationMethodSerialized static void insertKeyIntoColumns(const StringRef & key, MutableColumns & key_columns, const Sizes &) { - auto pos = key.data; + const auto * pos = key.data; for (auto & column : key_columns) pos = column->deserializeAndInsertFromArena(pos); } @@ -783,9 +783,9 @@ struct AggregatedDataVariants : private boost::noncopyable M(low_cardinality_keys128_two_level) \ M(low_cardinality_keys256_two_level) \ M(low_cardinality_key_string_two_level) \ - M(low_cardinality_key_fixed_string_two_level) \ + M(low_cardinality_key_fixed_string_two_level) - bool isLowCardinality() + bool isLowCardinality() const { switch (type) { @@ -972,7 +972,7 @@ public: /** Set a function that checks whether the current task can be aborted. */ - void setCancellationHook(const CancellationHook cancellation_hook); + void setCancellationHook(const CancellationHook & cancellation_hook); /// For external aggregation. void writeToTemporaryFile(AggregatedDataVariants & data_variants, const String & tmp_path); diff --git a/src/Interpreters/ExpressionActions.cpp b/src/Interpreters/ExpressionActions.cpp index f0dcf830c82..13daf52f5fc 100644 --- a/src/Interpreters/ExpressionActions.cpp +++ b/src/Interpreters/ExpressionActions.cpp @@ -67,7 +67,7 @@ ExpressionActionsPtr ExpressionActions::clone() const void ExpressionActions::linearizeActions() { - /// This function does the topological sort or DAG and fills all the fields of ExpressionActions. + /// This function does the topological sort on DAG and fills all the fields of ExpressionActions. /// Algorithm traverses DAG starting from nodes without children. /// For every node we support the number of created children, and if all children are created, put node into queue. struct Data diff --git a/src/Processors/Executors/PipelineExecutor.cpp b/src/Processors/Executors/PipelineExecutor.cpp index 1646a1a01fe..6192828784f 100644 --- a/src/Processors/Executors/PipelineExecutor.cpp +++ b/src/Processors/Executors/PipelineExecutor.cpp @@ -491,7 +491,7 @@ void PipelineExecutor::executeStepImpl(size_t thread_num, size_t num_threads, st while (!finished && !yield) { /// First, find any processor to execute. - /// Just travers graph and prepare any processor. + /// Just traverse graph and prepare any processor. while (!finished && node == nullptr) { { diff --git a/src/Processors/IProcessor.h b/src/Processors/IProcessor.h index c3abe40c3b7..ffdb363663d 100644 --- a/src/Processors/IProcessor.h +++ b/src/Processors/IProcessor.h @@ -249,7 +249,7 @@ public: UInt64 getInputPortNumber(const InputPort * input_port) const { UInt64 number = 0; - for (auto & port : inputs) + for (const auto & port : inputs) { if (&port == input_port) return number; @@ -263,7 +263,7 @@ public: UInt64 getOutputPortNumber(const OutputPort * output_port) const { UInt64 number = 0; - for (auto & port : outputs) + for (const auto & port : outputs) { if (&port == output_port) return number;