diff options
author | David Robillard <d@drobilla.net> | 2009-10-15 16:55:19 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-15 16:55:19 +0000 |
commit | cc8d52479fea5b2f4419463daf027ec11e813dc8 (patch) | |
tree | 4eca767f34ada1af47ff98ba616a349801f3a114 /src/tuplr.hpp | |
parent | 0ee5ad002dbe88c791bfa48e392094bade72a12c (diff) | |
download | resp-cc8d52479fea5b2f4419463daf027ec11e813dc8.tar.gz resp-cc8d52479fea5b2f4419463daf027ec11e813dc8.tar.bz2 resp-cc8d52479fea5b2f4419463daf027ec11e813dc8.zip |
Replace use of ATuple::at(0) with ATuple::head().
git-svn-id: http://svn.drobilla.net/resp/tuplr@227 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/tuplr.hpp')
-rw-r--r-- | src/tuplr.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tuplr.hpp b/src/tuplr.hpp index a89b612..02d79af 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -241,7 +241,7 @@ struct ATuple : public AST { newvec[_len++] = ast; _vec = newvec; } - const AST* front() const { assert(_len > 0); return _vec[0]; } + const AST* head() const { assert(_len > 0); return _vec[0]; } const AST* at(size_t i) const { assert(i < _len); return _vec[i]; } AST*& at(size_t i) { assert(i < _len); return _vec[i]; } size_t size() const { return _len; } @@ -483,15 +483,15 @@ struct PEnv : private map<const string, ASymbol*> { const ATuple* tup = exp->to<const ATuple*>(); if (tup) { if (tup->empty()) throw Error(exp->loc, "call to empty list"); - if (!tup->front()->to<const ATuple*>()) { - MF mf = mac(*tup->front()->to<const AString*>()); + if (!tup->head()->to<const ATuple*>()) { + MF mf = mac(*tup->head()->to<const AString*>()); const AST* expanded = (mf ? mf(*this, exp) : exp); const ATuple* expanded_tup = expanded->to<const ATuple*>(); - const PEnv::Handler* h = handler(true, *expanded_tup->front()->to<const AString*>()); + const PEnv::Handler* h = handler(true, *expanded_tup->head()->to<const AString*>()); if (h) return h->func(*this, expanded, h->arg); } - ATuple* parsed_tup = parseTuple(tup); // FIXME: leak + ATuple* parsed_tup = parseTuple(tup); return new ACall(parsed_tup); // Parse as regular call } const AString* str = exp->to<const AString*>(); |