X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/30e13695172732216d90b578db80f3c07e6b9544..11f104e5c1ab197246f93ed6eaa1f4e187096a3d:/include/wx/hashmap.h diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h index ae3667ce41..31280b1f5b 100644 --- a/include/wx/hashmap.h +++ b/include/wx/hashmap.h @@ -337,7 +337,8 @@ protected: \ /* returns NULL if not found */ \ Node** GetNodePtr( const const_key_type& key ) const \ { \ - Node** node = &m_table[m_hasher( key ) % m_tableBuckets]; \ + size_t bucket = m_hasher( key ) % m_tableBuckets; \ + Node** node = &m_table[bucket]; \ \ while( *node ) \ { \ @@ -353,7 +354,8 @@ protected: \ /* expressing it in terms of GetNodePtr is 5-8% slower :-( */ \ Node* GetNode( const const_key_type& key ) const \ { \ - Node* node = m_table[m_hasher( key ) % m_tableBuckets]; \ + size_t bucket = m_hasher( key ) % m_tableBuckets; \ + Node* node = m_table[bucket]; \ \ while( node ) \ { \ @@ -460,11 +462,13 @@ class WXDLLIMPEXP_BASE wxIntegerHash WX_HASH_MAP_NAMESPACE::hash shortHash; WX_HASH_MAP_NAMESPACE::hash ushortHash; +#if defined wxLongLong_t && !defined wxLongLongIsLong size_t longlongHash( wxLongLong_t x ) const { return longHash( wx_truncate_cast(long, x) ) ^ longHash( wx_truncate_cast(long, x >> (sizeof(long) * 8)) ); } +#endif public: wxIntegerHash() { }