diff options
author | David Robillard <d@drobilla.net> | 2011-01-13 05:46:36 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-13 05:46:36 +0000 |
commit | b8f81f6cb445cd26c2df4bb184ff3fb09a508744 (patch) | |
tree | 9bec2771b2283010b66ab20acca94b35edbb079d | |
parent | 944a94e27d9e15f30edc144d2a7ec7a438fd6bab (diff) | |
download | resp-b8f81f6cb445cd26c2df4bb184ff3fb09a508744.tar.gz resp-b8f81f6cb445cd26c2df4bb184ff3fb09a508744.tar.bz2 resp-b8f81f6cb445cd26c2df4bb184ff3fb09a508744.zip |
Tidier FreeVars::index.
git-svn-id: http://svn.drobilla.net/resp/trunk@409 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-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; |