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


##########
cpp/src/arrow/compute/light_array_internal.cc:
##########
@@ -323,8 +322,7 @@ Status ResizableArrayData::ResizeFixedLengthBuffers(int 
num_rows_new) {
 }
 
 Status ResizableArrayData::ResizeVaryingLengthBuffer() {
-  KeyColumnMetadata column_metadata;
-  column_metadata = ColumnMetadataFromDataType(data_type_).ValueOrDie();
+  KeyColumnMetadata column_metadata = 
ColumnMetadataFromDataType(data_type_).ValueOrDie();

Review Comment:
   Also, it seems `ColumnMetadataFromDataType(data_type_)` is being called from 
multiple methods. Why is the result not stored somewhere on the class?



##########
cpp/src/arrow/compute/light_array_internal.cc:
##########
@@ -323,8 +322,7 @@ Status ResizableArrayData::ResizeFixedLengthBuffers(int 
num_rows_new) {
 }
 
 Status ResizableArrayData::ResizeVaryingLengthBuffer() {
-  KeyColumnMetadata column_metadata;
-  column_metadata = ColumnMetadataFromDataType(data_type_).ValueOrDie();
+  KeyColumnMetadata column_metadata = 
ColumnMetadataFromDataType(data_type_).ValueOrDie();

Review Comment:
   Why not use `ARROW_ASSIGN_OR_RAISE`? We are able to return a `Status` here.



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