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

[GitHub] [arrow] westonpace commented on a diff in pull request #36418: GH-36417: [C++] Add Buffer::data_as, Buffer::mutable_data_as

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org