pitrou commented on a change in pull request #10896: URL: https://github.com/apache/arrow/pull/10896#discussion_r685371720
########## File path: cpp/src/arrow/compute/kernels/scalar_validity.cc ########## @@ -76,6 +77,22 @@ struct IsInfOperator { struct IsNullOperator { static Status Call(KernelContext* ctx, const Scalar& in, Scalar* out) { + bool is_nan_value = false; + bool is_floating = false; + if (in.type == float32()) { + is_nan_value = std::isnan(internal::UnboxScalar<FloatType>::Unbox(in)); + is_floating = true; + } else if (in.type == float64()) { + is_nan_value = std::isnan(internal::UnboxScalar<DoubleType>::Unbox(in)); + is_floating = true; + } Review comment: This is the version for Scalar inputs. Micro-optimizing it is futile. The version for Array inputs may be more interesting ;-) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org