diff options
author | Max Horn | 2006-06-05 17:56:27 +0000 |
---|---|---|
committer | Max Horn | 2006-06-05 17:56:27 +0000 |
commit | 61737da11580b495e35097f8f39974132349cd2d (patch) | |
tree | 55e7f237b8684cf5d25c4757f6e4934cf49df021 /gui | |
parent | 0f18020010d36f4dce5e73edc3fd4f87c434e5e1 (diff) | |
download | scummvm-rg350-61737da11580b495e35097f8f39974132349cd2d.tar.gz scummvm-rg350-61737da11580b495e35097f8f39974132349cd2d.tar.bz2 scummvm-rg350-61737da11580b495e35097f8f39974132349cd2d.zip |
Slightly optimize 'getVar(FOO)' usage pattern
svn-id: r22937
Diffstat (limited to 'gui')
-rw-r--r-- | gui/eval.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gui/eval.h b/gui/eval.h index 012d8675e6..37309d1300 100644 --- a/gui/eval.h +++ b/gui/eval.h @@ -49,11 +49,14 @@ public: 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(); } |