More hashing of sequential indices

ryzomclassic-develop
kaetemi 3 years ago
parent b9de2e99a3
commit 30117e92be
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -26,6 +26,7 @@
#include "nel/misc/types_nl.h"
#include "nel/net/unified_network.h"
#include "nel/misc/wang_hash.h"
#include <limits>
@ -300,7 +301,7 @@ private:
/// Get Hash code
uint32 getHashCode() const
{
return (uint32)(getIndex());
return NLMISC::wangHash((uint32)(getIndex()));
}
union

@ -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<TDataSetRow, CWorldEntity *, TDataSetRow::CHashCode> 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<NLMISC::CEntityId, CPlayerInfos*, CEntityIdHash > TMapIdToPlayerInfos;

Loading…
Cancel
Save