[Gridflow-cvs] [svn] commit: r6806 - in /trunk/src: gridflow.hxx numop2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sun Nov 6 15:18:47 EST 2011


Author: matju
Date: Sun Nov  6 15:18:47 2011
New Revision: 6806

Log:
try using hash_map...

Modified:
    trunk/src/gridflow.hxx
    trunk/src/numop2.cxx

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Sun Nov  6 15:18:47 2011
@@ -609,11 +609,11 @@
 	}
 };
 
-struct t_symbol_eq {bool operator()(t_symbol *a,t_symbol *b) {return a==b;}};
+namespace __gnu_cxx {template <> struct hash<t_symbol*> {size_t operator()(const t_symbol *a) const {return size_t(a);}};};
 extern NumberType number_type_table[];
 extern map<t_symbol *,NumberType *> number_type_dict;
-extern map<t_symbol *,Numop *> op_dict;
-//extern hash_map<t_symbol *,Numop *,__gnu_cxx::hash<t_symbol*>,t_symbol_eq> op_dict;
+//extern map<t_symbol *,Numop *> op_dict;
+extern hash_map<t_symbol *,Numop *> op_dict;
 
 static inline NumberTypeE convert(const t_atom2 &x, NumberTypeE *bogus) {
 	if (x.a_type!=A_SYMBOL) RAISE("expected number-type, got %s",x.to_s().data()); return NumberTypeE_find(string(x.a_symbol->s_name));}

Modified: trunk/src/numop2.cxx
==============================================================================
--- trunk/src/numop2.cxx (original)
+++ trunk/src/numop2.cxx Sun Nov  6 15:18:47 2011
@@ -378,7 +378,8 @@
 
 #ifdef PASS1
 map<t_symbol *,NumberType *> number_type_dict;
-map<t_symbol *,Numop *> op_dict;
+//map<t_symbol *,Numop *> op_dict;
+hash_map<t_symbol *,Numop *> op_dict;
 void startup_numop2 () {
 	INIT_TABLE(op_dict,op_table1)
 	INIT_TABLE(op_dict,op_table2)



More information about the Gridflow-cvs mailing list