rok commented on code in PR #37940:
URL: https://github.com/apache/arrow/pull/37940#discussion_r1340529289
##########
cpp/src/parquet/encoding.cc:
##########
@@ -2183,15 +2185,21 @@ class DeltaBitPackEncoder : public EncoderImpl, virtual
public TypedEncoder<DTyp
void FlushBlock();
+ private:
+ constexpr T SafeSubtract(T a, T b) const {
+ constexpr WT mask = static_cast<WT>(static_cast<UT>(static_cast<T>(-1)));
+ return static_cast<T>((static_cast<WT>(a) - static_cast<WT>(b)) & mask);
+ }
Review Comment:
Would this maybe better fit in
[int_util_overflow.h](https://github.com/apache/arrow/blob/main/cpp/src/arrow/util/int_util_overflow.h)?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]