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


##########
cpp/src/arrow/testing/matchers.h:
##########
@@ -430,14 +430,10 @@ DataEqMatcher DataEqArray(T type, const 
std::vector<std::optional<ValueType>>& v
   static const bool need_safe_append = !is_fixed_width(T::type_id);
 
   for (auto value : values) {
-    if (value) {
-      if (need_safe_append) {
-        builder.UnsafeAppend(*value);
-      } else {
-        DCHECK_OK(builder.Append(*value));
-      }
+    if (need_safe_append) {
+      builder.UnsafeAppendOrNull(value);

Review Comment:
   It's interesting that the `need_safe_append` use seems flipped. It probably 
should be:
   ```c++
       if (need_safe_append) {
         DCHECK_OK(builder.AppendOrNull(value));
       } else {
         builder.UnsafeAppendOrNull(value);
       }
   ```
   
   
   @bkietz What do you think?
   



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