diff --git a/ryzom/common/src/game_share/base_types.h b/ryzom/common/src/game_share/base_types.h index 86706a08d..38c90785d 100644 --- a/ryzom/common/src/game_share/base_types.h +++ b/ryzom/common/src/game_share/base_types.h @@ -26,6 +26,7 @@ #include "nel/misc/types_nl.h" #include "nel/net/unified_network.h" +#include "nel/misc/wang_hash.h" #include @@ -300,7 +301,7 @@ private: /// Get Hash code uint32 getHashCode() const { - return (uint32)(getIndex()); + return NLMISC::wangHash((uint32)(getIndex())); } union diff --git a/ryzom/server/src/gpm_service/world_position_manager.h b/ryzom/server/src/gpm_service/world_position_manager.h index a205aca89..1a5c48706 100644 --- a/ryzom/server/src/gpm_service/world_position_manager.h +++ b/ryzom/server/src/gpm_service/world_position_manager.h @@ -140,15 +140,8 @@ public: //friend void CWorldEntity::createPrimitive(NLPACS::UMoveContainer *pMoveContainer, uint8 worldImage); friend void CWorldEntity::removePrimitive(); - struct CEntityIdHash - { - enum { bucket_size = 4, min_buckets = 8 }; - size_t operator () (const NLMISC::CEntityId &id) const { return (uint32)id.getShortId(); } - size_t operator () (const NLMISC::CEntityId &left, const NLMISC::CEntityId &right) const { return left < right; } - }; - /// Container of entities (all entities are referenced by this container - typedef CHashMap< NLMISC::CEntityId, CWorldEntity *, CEntityIdHash > TWorldEntityContainerByEId; + typedef CHashMap< NLMISC::CEntityId, CWorldEntity *, NLMISC::CEntityIdHashMapTraits > TWorldEntityContainerByEId; typedef CHashMap TWorldEntityContainer; typedef CCell **TWorldCellsMap; @@ -167,7 +160,7 @@ public: typedef std::list< CWorldEntity * > TRemovedEntityContainer; typedef std::set< NLMISC::CEntityId > TSetId; - typedef CHashMap< NLMISC::CEntityId, CAroundEntityInfo, CEntityIdHash > TEntitiesAroundEntityContainer; + typedef CHashMap< NLMISC::CEntityId, CAroundEntityInfo, NLMISC::CEntityIdHashMapTraits > TEntitiesAroundEntityContainer; //typedef std::hash_map TMapIdToPlayerInfos;