You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/09/03 01:54:57 UTC
[GitHub] [arrow] cyb70289 commented on a change in pull request #11050: ARROW-13824: [C++][Compute] Make constexpr BooleanToNumber kernel
cyb70289 commented on a change in pull request #11050:
URL: https://github.com/apache/arrow/pull/11050#discussion_r701532028
##########
File path: cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc
##########
@@ -264,10 +264,8 @@ Status CastIntegerToFloating(KernelContext* ctx, const ExecBatch& batch, Datum*
struct BooleanToNumber {
template <typename OutValue, typename Arg0Value>
- static OutValue Call(KernelContext*, Arg0Value val, Status*) {
- constexpr auto kOne = static_cast<OutValue>(1);
- constexpr auto kZero = static_cast<OutValue>(0);
- return val ? kOne : kZero;
Review comment:
Looks this original code is easier to read?
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org