diff options
Diffstat (limited to 'src/resp.hpp')
-rw-r--r-- | src/resp.hpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/resp.hpp b/src/resp.hpp index 41f1826..cf74e56 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -789,17 +789,12 @@ struct CEnv { const ATuple* const fn; const std::string implName; int32_t index(const ASymbol* sym) { - const_iterator i = begin(); - for (; i != end(); ++i) + for (const_iterator i = begin(); i != end(); ++i) if ((*i)->sym() == sym->sym()) - break; + return i - begin() + 1; - if (i != end()) { - return i - begin() + 1; - } else { - push_back(sym); - return size(); - } + push_back(sym); + return size(); } }; typedef std::stack<FreeVars> LiftStack; |