aboutsummaryrefslogtreecommitdiff
path: root/externals/ace/Hashable.cpp
diff options
context:
space:
mode:
authorXanadu <none@none>2010-07-20 02:49:28 +0200
committerXanadu <none@none>2010-07-20 02:49:28 +0200
commit79622802f397258ee0f34327ba3ae6977ca3e7ff (patch)
tree1868946c234ab9ee256a6b7766a15713eae94235 /externals/ace/Hashable.cpp
parent7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff)
parentf906976837502fa5aa81b982b901d1509f5aa0c4 (diff)
Merge. Revision history for source files should be all back now.
--HG-- branch : trunk rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'externals/ace/Hashable.cpp')
-rw-r--r--externals/ace/Hashable.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/externals/ace/Hashable.cpp b/externals/ace/Hashable.cpp
new file mode 100644
index 00000000000..94c25faf1c8
--- /dev/null
+++ b/externals/ace/Hashable.cpp
@@ -0,0 +1,36 @@
+//$Id: Hashable.cpp 80826 2008-03-04 14:51:23Z wotte $
+
+#include "ace/Hashable.h"
+
+#if !defined (__ACE_INLINE__)
+#include "ace/Hashable.inl"
+#endif /* __ACE_INLINE __ */
+
+
+ACE_RCSID (ace,
+ Hashable,
+ "$Id: Hashable.cpp 80826 2008-03-04 14:51:23Z wotte $")
+
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_Hashable::~ACE_Hashable (void)
+{
+}
+
+unsigned long
+ACE_Hashable::hash (void) const
+{
+ // In doing the check below, we take chance of paying a performance
+ // price when the hash value is zero. But, that will (hopefully)
+ // happen far less often than a non-zero value, so this caching
+ // strategy should pay off, esp. if hash computation is expensive
+ // relative to the simple comparison.
+
+ if (this->hash_value_ == 0)
+ this->hash_value_ = this->hash_i ();
+
+ return this->hash_value_;
+}
+
+ACE_END_VERSIONED_NAMESPACE_DECL