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


##########
cpp/src/arrow/array/data.cc:
##########
@@ -130,7 +130,8 @@ std::shared_ptr<ArrayData> 
ArrayData::Make(std::shared_ptr<DataType> type, int64
 }
 
 std::shared_ptr<ArrayData> ArrayData::Slice(int64_t off, int64_t len) const {
-  ARROW_CHECK_LE(off, length) << "Slice offset greater than array length";
+  ARROW_CHECK_LE(off, length) << "Slice offset (" << off
+                              << ") greater than array length (" << length << 
")";

Review Comment:
   It shouldn't. The `operator<<` is only invoked when the assertion fails. 
Though operator precedence makes me slightly uneasy:
   ```c++
   #define ARROW_CHECK_OR_LOG(condition, level) \
     ARROW_PREDICT_TRUE(condition)              \
     ? ARROW_IGNORE_EXPR(0)                     \
     : ::arrow::util::Voidify() & ARROW_LOG(level) << " Check failed: " 
#condition " "
   ```



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

Reply via email to