From 7ba960e0a5fe792041e641aac903542a098d0e53 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Mon, 9 May 2022 14:16:35 -0700 Subject: [PATCH] fold parameter pack --- .../cudf/table/experimental/row_operators.cuh | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/cpp/include/cudf/table/experimental/row_operators.cuh b/cpp/include/cudf/table/experimental/row_operators.cuh index 0319c7e682c..76daa6dbca4 100644 --- a/cpp/include/cudf/table/experimental/row_operators.cuh +++ b/cpp/include/cudf/table/experimental/row_operators.cuh @@ -277,16 +277,6 @@ class device_row_comparator { std::optional> const _null_precedence; }; // class device_row_comparator -template -__device__ bool any_equal(weak_ordering result, weak_ordering v, WeakOrderings... vs) -{ - if constexpr (sizeof...(WeakOrderings) == 0) { - return result == v; - } else { - return result == v or any_equal(result, vs...); - } -} - /** * @brief Wraps and interprets the result of templated Comparator that returns a weak_ordering. * Returns true if the weak_ordering matches any of the templated values. @@ -295,12 +285,12 @@ __device__ bool any_equal(weak_ordering result, weak_ordering v, WeakOrderings.. * @tparam values weak_ordering parameter pack of orderings to interpret as true */ template -struct weak_ordering_comparator_impl { - __device__ bool operator()(size_type const& lhs, size_type const& rhs) - { - return any_equal(comparator(lhs, rhs), values...); - } - Comparator comparator; +struct weak_ordering_comparator_impl{ + __device__ bool operator()(size_type const& lhs, size_type const& rhs){ + weak_ordering const result = comparator(lhs, rhs); + return ( (result == values) || ...); + } + Comparator comparator; }; /**