[Gridflow-cvs] [svn] commit: r6807 - /trunk/src/gridflow.hxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sun Nov 6 15:25:34 EST 2011


Author: matju
Date: Sun Nov  6 15:25:34 2011
New Revision: 6807

Log:
more efficient hashing for symbols, because they're usually multiples of 4

Modified:
    trunk/src/gridflow.hxx

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Sun Nov  6 15:25:34 2011
@@ -609,7 +609,7 @@
 	}
 };
 
-namespace __gnu_cxx {template <> struct hash<t_symbol*> {size_t operator()(const t_symbol *a) const {return size_t(a);}};};
+namespace __gnu_cxx {template <> struct hash<t_symbol*> {size_t operator()(const t_symbol *a) const {size_t b = size_t(a); return b^(b>>2);}};}
 extern NumberType number_type_table[];
 extern map<t_symbol *,NumberType *> number_type_dict;
 //extern map<t_symbol *,Numop *> op_dict;



More information about the Gridflow-cvs mailing list