Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Feb 24, 2021
1 parent b5126ab commit d1f16aa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cpp/src/arrow/compute/kernels/codegen_internal.h
Expand Up @@ -663,14 +663,16 @@ struct ScalarUnaryNotNullStateful {
static void Exec(const ThisType& functor, KernelContext* ctx, const ArrayData& arg0,
Datum* out) {
ArrayData* out_arr = out->mutable_array();
auto out_data = out_arr->GetMutableValues<uint8_t>(1, 0) + 16 * out_arr->offset;
// Decimal128 data buffers are not safely reinterpret_cast-able on big-endian
using endian_agnostic = std::array<uint8_t, sizeof(Decimal128)>;
auto out_data = out_arr->GetMutableValues<endian_agnostic>(1);
VisitArrayValuesInline<Arg0Type>(
arg0,
[&](Arg0Value v) {
functor.op.template Call<OutValue, Arg0Value>(ctx, v).ToBytes(out_data);
out_data += 16;
functor.op.template Call<OutValue, Arg0Value>(ctx, v).ToBytes(
out_data++->data());
},
[&]() { out_data += 16; });
[&]() { ++out_data; });
}
};

Expand Down

0 comments on commit d1f16aa

Please sign in to comment.