westonpace commented on code in PR #36418:
URL: https://github.com/apache/arrow/pull/36418#discussion_r1254540363
##########
cpp/src/arrow/array/array_nested.cc:
##########
@@ -611,9 +611,10 @@ const std::shared_ptr<Array>& StructArray::field(int i)
const {
return boxed_fields_[i];
}
-std::shared_ptr<Array> StructArray::GetFieldByName(const std::string& name)
const {
+const std::shared_ptr<Array>& StructArray::GetFieldByName(const std::string&
name) const {
+ static std::shared_ptr<Array> null;
Review Comment:
A static like this is also an implicit mutex so it has the same
synchronization cost as a refcount
--
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]