[Gridflow-cvs] [svn] commit: r6802 - /trunk/src/gridflow.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sun Nov 6 14:39:34 EST 2011


Author: matju
Date: Sun Nov  6 14:39:34 2011
New Revision: 6802

Log:
much faster numop lookup

Modified:
    trunk/src/gridflow.cxx

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Sun Nov  6 14:39:34 2011
@@ -243,8 +243,9 @@
 Numop *convert(const t_atom2 &x, Numop **bogus) {
 	if (x.a_type!=A_SYMBOL) RAISE("expected numop (as symbol)");
 	string k = string(x.a_symbol->s_name);
-	if (op_dict.find(k)==op_dict.end()) RAISE("expected numop name, not '%s'", k.data());
-	return op_dict[k];
+	typeof(op_dict.begin()) found = op_dict.find(k);
+	if (found==op_dict.end()) RAISE("expected numop name, not '%s'", k.data());
+	return found->second;
 }
 
 int Numop::arity () {RAISE("Numop::arity() : pure-virtual function called !");}



More information about the Gridflow-cvs mailing list