aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2006-06-01 22:44:43 +0000
committerWillem Jan Palenstijn2006-06-01 22:44:43 +0000
commit39451e99475106aad0b0534750dda4a641e958a4 (patch)
treef8fc9b606dd9b51ce6a15465683f720eab5a7fd7 /gui
parenta5c03dce0a8b8621b05d8f48909d9df069f4ef86 (diff)
downloadscummvm-rg350-39451e99475106aad0b0534750dda4a641e958a4.tar.gz
scummvm-rg350-39451e99475106aad0b0534750dda4a641e958a4.tar.bz2
scummvm-rg350-39451e99475106aad0b0534750dda4a641e958a4.zip
small optimization in evaluator variable lookup
svn-id: r22822
Diffstat (limited to 'gui')
-rw-r--r--gui/eval.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/gui/eval.cpp b/gui/eval.cpp
index 1fa178811a..537d172c3a 100644
--- a/gui/eval.cpp
+++ b/gui/eval.cpp
@@ -289,11 +289,15 @@ int Eval::getVar_(const char *s, bool includeAliases) {
return val;
String var = String(s);
- if (includeAliases && _aliases.contains(var))
- var = _aliases[var];
+ if (includeAliases) {
+ AliasesMap::const_iterator itera = _aliases.find(var);
+ if (itera != _aliases.end())
+ var = itera->_value;
+ }
- if (_vars.contains(var))
- return _vars[var];
+ VariablesMap::const_iterator iterv = _vars.find(var);
+ if (iterv != _vars.end())
+ return iterv->_value;
return EVAL_UNDEF_VAR;
}