From 39451e99475106aad0b0534750dda4a641e958a4 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 1 Jun 2006 22:44:43 +0000 Subject: small optimization in evaluator variable lookup svn-id: r22822 --- gui/eval.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gui') 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; } -- cgit v1.2.3