From: Michael Wetherell Date: Tue, 27 Sep 2005 19:24:47 +0000 (+0000) Subject: Remove cast of hash value to unsigned long, hash value can be bigger X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/30e13695172732216d90b578db80f3c07e6b9544 Remove cast of hash value to unsigned long, hash value can be bigger git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h index ad8005c31c..ae3667ce41 100644 --- a/include/wx/hashmap.h +++ b/include/wx/hashmap.h @@ -337,8 +337,7 @@ protected: \ /* returns NULL if not found */ \ Node** GetNodePtr( const const_key_type& key ) const \ { \ - unsigned long hash = wx_static_cast(unsigned long, m_hasher( key )); \ - Node** node = &m_table[hash % m_tableBuckets]; \ + Node** node = &m_table[m_hasher( key ) % m_tableBuckets]; \ \ while( *node ) \ { \ @@ -354,8 +353,7 @@ protected: \ /* expressing it in terms of GetNodePtr is 5-8% slower :-( */ \ Node* GetNode( const const_key_type& key ) const \ { \ - unsigned long hash = wx_static_cast(unsigned long, m_hasher( key )); \ - Node* node = m_table[hash % m_tableBuckets]; \ + Node* node = m_table[m_hasher( key ) % m_tableBuckets]; \ \ while( node ) \ { \