From cf72c91bf327becb121e8f8c8c94b9636a6edabc Mon Sep 17 00:00:00 2001 From: Jin Shang Date: Tue, 19 Dec 2023 09:26:42 +0800 Subject: [PATCH] fix --- cpp/src/arrow/compute/kernels/scalar_string_ascii.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc b/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc index 8555474ea6da5..4d4b77abed508 100644 --- a/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc +++ b/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc @@ -2596,10 +2596,12 @@ struct SliceBytesTransform : StringSliceTransformBase { } if (step < 0) { - return std::max(static_cast(0), (stop - start + step + 1) / step); + return static_cast( + std::max(static_cast(0), (stop - start + step + 1) / step)); } - return std::max(static_cast(0), (stop - start + step - 1) / step); + return static_cast( + std::max(static_cast(0), (stop - start + step - 1) / step)); } };