|
24 | 24 |
|
25 | 25 | #include <functional> |
26 | 26 | #include <numeric> |
| 27 | +#include <utility> |
27 | 28 |
|
28 | 29 | namespace cudf { |
29 | 30 | namespace detail { |
@@ -510,7 +511,7 @@ class quantile_aggregation final : public groupby_aggregation, public reduce_agg |
510 | 511 | void finalize(aggregation_finalizer& finalizer) const override { finalizer.visit(*this); } |
511 | 512 |
|
512 | 513 | private: |
513 | | - size_t hash_impl() const |
| 514 | + [[nodiscard]] size_t hash_impl() const |
514 | 515 | { |
515 | 516 | return std::hash<int>{}(static_cast<int>(_interpolation)) ^ |
516 | 517 | std::accumulate( |
@@ -596,7 +597,10 @@ class nunique_aggregation final : public groupby_aggregation, |
596 | 597 | void finalize(aggregation_finalizer& finalizer) const override { finalizer.visit(*this); } |
597 | 598 |
|
598 | 599 | private: |
599 | | - size_t hash_impl() const { return std::hash<int>{}(static_cast<int>(_null_handling)); } |
| 600 | + [[nodiscard]] size_t hash_impl() const |
| 601 | + { |
| 602 | + return std::hash<int>{}(static_cast<int>(_null_handling)); |
| 603 | + } |
600 | 604 | }; |
601 | 605 |
|
602 | 606 | /** |
@@ -638,7 +642,7 @@ class nth_element_aggregation final : public groupby_aggregation, |
638 | 642 | void finalize(aggregation_finalizer& finalizer) const override { finalizer.visit(*this); } |
639 | 643 |
|
640 | 644 | private: |
641 | | - size_t hash_impl() const |
| 645 | + [[nodiscard]] size_t hash_impl() const |
642 | 646 | { |
643 | 647 | return std::hash<size_type>{}(_n) ^ std::hash<int>{}(static_cast<int>(_null_handling)); |
644 | 648 | } |
@@ -763,7 +767,10 @@ class collect_list_aggregation final : public rolling_aggregation, |
763 | 767 | void finalize(aggregation_finalizer& finalizer) const override { finalizer.visit(*this); } |
764 | 768 |
|
765 | 769 | private: |
766 | | - size_t hash_impl() const { return std::hash<int>{}(static_cast<int>(_null_handling)); } |
| 770 | + [[nodiscard]] size_t hash_impl() const |
| 771 | + { |
| 772 | + return std::hash<int>{}(static_cast<int>(_null_handling)); |
| 773 | + } |
767 | 774 | }; |
768 | 775 |
|
769 | 776 | /** |
@@ -813,7 +820,7 @@ class collect_set_aggregation final : public rolling_aggregation, |
813 | 820 | void finalize(aggregation_finalizer& finalizer) const override { finalizer.visit(*this); } |
814 | 821 |
|
815 | 822 | protected: |
816 | | - size_t hash_impl() const |
| 823 | + [[nodiscard]] size_t hash_impl() const |
817 | 824 | { |
818 | 825 | return std::hash<int>{}(static_cast<int>(_null_handling) ^ static_cast<int>(_nulls_equal) ^ |
819 | 826 | static_cast<int>(_nans_equal)); |
@@ -866,10 +873,10 @@ class lead_lag_aggregation final : public rolling_aggregation { |
866 | 873 | class udf_aggregation final : public rolling_aggregation { |
867 | 874 | public: |
868 | 875 | udf_aggregation(aggregation::Kind type, |
869 | | - std::string const& user_defined_aggregator, |
| 876 | + std::string user_defined_aggregator, |
870 | 877 | data_type output_type) |
871 | 878 | : aggregation{type}, |
872 | | - _source{user_defined_aggregator}, |
| 879 | + _source{std::move(user_defined_aggregator)}, |
873 | 880 | _operator_name{(type == aggregation::PTX) ? "rolling_udf_ptx" : "rolling_udf_cuda"}, |
874 | 881 | _function_name{"rolling_udf"}, |
875 | 882 | _output_type{output_type} |
@@ -973,7 +980,7 @@ class merge_sets_aggregation final : public groupby_aggregation, public reduce_a |
973 | 980 | void finalize(aggregation_finalizer& finalizer) const override { finalizer.visit(*this); } |
974 | 981 |
|
975 | 982 | protected: |
976 | | - size_t hash_impl() const |
| 983 | + [[nodiscard]] size_t hash_impl() const |
977 | 984 | { |
978 | 985 | return std::hash<int>{}(static_cast<int>(_nulls_equal) ^ static_cast<int>(_nans_equal)); |
979 | 986 | } |
@@ -1046,7 +1053,7 @@ class covariance_aggregation final : public groupby_aggregation { |
1046 | 1053 | void finalize(aggregation_finalizer& finalizer) const override { finalizer.visit(*this); } |
1047 | 1054 |
|
1048 | 1055 | protected: |
1049 | | - size_t hash_impl() const |
| 1056 | + [[nodiscard]] size_t hash_impl() const |
1050 | 1057 | { |
1051 | 1058 | return std::hash<size_type>{}(_min_periods) ^ std::hash<size_type>{}(_ddof); |
1052 | 1059 | } |
@@ -1088,7 +1095,7 @@ class correlation_aggregation final : public groupby_aggregation { |
1088 | 1095 | void finalize(aggregation_finalizer& finalizer) const override { finalizer.visit(*this); } |
1089 | 1096 |
|
1090 | 1097 | protected: |
1091 | | - size_t hash_impl() const |
| 1098 | + [[nodiscard]] size_t hash_impl() const |
1092 | 1099 | { |
1093 | 1100 | return std::hash<int>{}(static_cast<int>(_type)) ^ std::hash<size_type>{}(_min_periods); |
1094 | 1101 | } |
|
0 commit comments