alb3rtobr commented on a change in pull request #619:
URL: https://github.com/apache/geode-native/pull/619#discussion_r441823764



##########
File path: cppcache/src/PdxTypeRegistry.hpp
##########
@@ -53,7 +53,20 @@ typedef std::unordered_map<std::shared_ptr<PdxSerializable>,
                            dereference_hash<std::shared_ptr<CacheableKey>>,
                            dereference_equal_to<std::shared_ptr<CacheableKey>>>
     PreservedHashMap;
-typedef std::map<std::shared_ptr<PdxType>, int32_t, PdxTypeLessThan>
+
+struct PdxTypeHashCode {
+  std::size_t operator()(std::shared_ptr<PdxType> const& pdx) const {
+    return pdx ? pdx->hashcode() : 0;
+  }
+};
+
+struct PdxTypeEqualCmp {
+  bool operator()(std::shared_ptr<PdxType> const& first, 
std::shared_ptr<PdxType> const& second) const{
+    return first->hashcode() == second->hashcode();

Review comment:
       Agree, but I dont want to check if the objects are equals, I just want 
to check if two `PdxType` objects have the same hash.
   
   Two `PdxType` objects should be equals if they have the same classname and 
their fields have the same types, names and values.
   And two keys of the `pdxTypeToTypeId` map will be equals if they have the 
same hash, which means they have the same classname, and their fields have the 
same types and names (values are not checked 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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to