From b4deb5d9428e933c1490508ea923ded0cff48c03 Mon Sep 17 00:00:00 2001 From: Karthikeyan Natarajan Date: Wed, 28 Jul 2021 02:07:14 +0530 Subject: [PATCH] fix const ptr, remove temp variable --- cpp/include/cudf/detail/indexalator.cuh | 3 +-- cpp/src/replace/nulls.cu | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cpp/include/cudf/detail/indexalator.cuh b/cpp/include/cudf/detail/indexalator.cuh index d56f34a5765..d546162fc7a 100644 --- a/cpp/include/cudf/detail/indexalator.cuh +++ b/cpp/include/cudf/detail/indexalator.cuh @@ -157,8 +157,7 @@ struct base_indexalator { */ CUDA_HOST_DEVICE_CALLABLE difference_type operator-(T const& rhs) const { - auto& derived = static_cast(*this); - return (derived.p_ - rhs.p_) / width_; + return (static_cast(*this).p_ - rhs.p_) / width_; } /** diff --git a/cpp/src/replace/nulls.cu b/cpp/src/replace/nulls.cu index a336de6fb49..87e850e6676 100644 --- a/cpp/src/replace/nulls.cu +++ b/cpp/src/replace/nulls.cu @@ -289,8 +289,8 @@ std::unique_ptr replace_nulls_column_kernel_forwarder::operator()< template struct replace_nulls_functor { - T* value_it; - replace_nulls_functor(T* _value_it) : value_it(_value_it) {} + T const* value_it; + replace_nulls_functor(T const* _value_it) : value_it(_value_it) {} __device__ T operator()(T input, bool is_valid) { return is_valid ? input : *value_it; } };