You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/05/10 14:13:10 UTC

[GitHub] [geode-native] pivotal-jbarrett commented on a diff in pull request #969: GEODE-10276: Refactor PDX (de)serialization code

pivotal-jbarrett commented on code in PR #969:
URL: https://github.com/apache/geode-native/pull/969#discussion_r869292240


##########
cppcache/src/CacheableObjectArray.cpp:
##########
@@ -53,6 +54,18 @@ size_t CacheableObjectArray::objectSize() const {
   }
   return size;
 }
+
+std::string CacheableObjectArray::getClassName() const {
+  if (!empty()) {
+    auto&& item = *begin();
+
+    if (auto pdx = dynamic_cast<PdxSerializable*>(item.get())) {
+      return pdx->getClassName();
+    }
+  }
+
+  return "java.lang.Object";

Review Comment:
   What if we make this string a `const` value in this compilation unit and change the return type of this method to return `const std::string&` so we aren't copy constructing strings on return.



-- 
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: notifications-unsubscribe@geode.apache.org

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