gaussianrecurrence commented on a change in pull request #806:
URL: https://github.com/apache/geode-native/pull/806#discussion_r662179040



##########
File path: cppcache/src/PdxHelper.cpp
##########
@@ -175,61 +163,59 @@ std::shared_ptr<PdxSerializable> 
PdxHelper::deserializePdx(DataInput& dataInput,
   auto pType = pdxTypeRegistry->getPdxType(typeId);
   if (pType) {
     // this may happen with PdxInstanceFactory
-    pdxLocalType = pdxTypeRegistry->getLocalPdxType(pType->getPdxClassName());
+    localType = pdxTypeRegistry->getLocalPdxType(pType->getPdxClassName());
   }
-  if (pType && pdxLocalType) {
+  if (pType && localType) {
     // type found
     auto&& pdxClassname = pType->getPdxClassName();
     LOGDEBUG("deserializePdx ClassName = " + pdxClassname +
              ", isLocal = " + std::to_string(pType->isLocal()));
 
-    pdxObjectptr = serializationRegistry->getPdxSerializableType(pdxClassname);
+    object = serializationRegistry->getPdxSerializableType(pdxClassname);
     if (pType->isLocal())  // local type no need to read Unread data
     {
       auto plr = PdxLocalReader(dataInput, pType, length, pdxTypeRegistry);
-      pdxObjectptr->fromData(plr);
+      object->fromData(plr);
       plr.moveStream();
     } else {
       auto prr = PdxRemoteReader(dataInput, pType, length, pdxTypeRegistry);
-      pdxObjectptr->fromData(prr);
+      object->fromData(prr);
       auto mergedVersion = pdxTypeRegistry->getMergedType(pType->getTypeId());
 
-      auto preserveData = prr.getPreservedData(mergedVersion, pdxObjectptr);
+      auto preserveData = prr.getPreservedData(mergedVersion, object);
       if (preserveData != nullptr) {
         pdxTypeRegistry->setPreserveData(
-            pdxObjectptr, preserveData,
+            object, preserveData,
             cacheImpl
                 ->getExpiryTaskManager());  // it will set data in weakhashmap
       }
       prr.moveStream();
 
-      if (auto pdxWrapper =
-              std::dynamic_pointer_cast<PdxWrapper>(pdxObjectptr)) {
-        if (!pdxWrapper->getObject()) {
+      if (auto wrapper = std::dynamic_pointer_cast<PdxWrapper>(object)) {
+        if (!wrapper->getObject()) {
           // No serializer was registered to deserialize this type.
           // Fall back to PdxInstance
           return nullptr;
         }
       }
     }
   } else {
-    // type not found; need to get from server
-    if (!pType) {
+    if (pType == nullptr) {

Review comment:
       Indeed, sorry I try to leave aside my coding conventions hehe, but 
sometimes I don't notice. Will change it




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