[Scummvm-cvs-logs] SF.net SVN: scummvm: [22937] scummvm/trunk/gui/eval.h

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Jun 5 19:56:32 CEST 2006


Revision: 22937
Author:   fingolfin
Date:     2006-06-05 10:56:27 -0700 (Mon, 05 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22937&view=rev

Log Message:
-----------
Slightly optimize 'getVar(FOO)' usage pattern

Modified Paths:
--------------
    scummvm/trunk/gui/eval.h
Modified: scummvm/trunk/gui/eval.h
===================================================================
--- scummvm/trunk/gui/eval.h	2006-06-05 17:43:30 UTC (rev 22936)
+++ scummvm/trunk/gui/eval.h	2006-06-05 17:56:27 UTC (rev 22937)
@@ -49,12 +49,15 @@
 	void setVar(const String &name, int val) { _vars[name.c_str()] = val; }
 	void setAlias(const char *name, const String &val) { _aliases[name] = val; }
 
-	int getVar(const String &s) { return getVar_(s.c_str()); }
-	int getVar(const String &s, int def) {
-		int val = getVar_(s.c_str());
+	int getVar(const char *s) { return getVar_(s); }
+	int getVar(const char *s, int def) {
+		int val = getVar_(s);
 		return (val == EVAL_UNDEF_VAR) ? def : val;
-	};
+	}
 
+	int getVar(const String &s) { return getVar(s.c_str()); }
+	int getVar(const String &s, int def) { return getVar(s.c_str(), def); }
+
 	uint getNumVars() { return _vars.size(); }
 
 	void reset();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list