You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pitrou (via GitHub)" <gi...@apache.org> on 2023/06/14 10:58:38 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #35997: GH-35576: [C++] Make Decimal{128,256}::FromReal more accurate

pitrou commented on code in PR #35997:
URL: https://github.com/apache/arrow/pull/35997#discussion_r1229413297


##########
cpp/src/arrow/util/basic_decimal.cc:
##########
@@ -1188,14 +857,14 @@ BasicDecimal256& BasicDecimal256::operator<<=(uint32_t bits) {
   if (bits == 0) {
     return *this;
   }
-  int cross_word_shift = bits / 64;
-  if (static_cast<size_t>(cross_word_shift) >= array_.size()) {
+  const int cross_word_shift = bits / 64;
+  if (cross_word_shift >= kWordWidth) {

Review Comment:
   You're right that it's confusing. I'll rename it to `kNumWords`.



-- 
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