aboutsummaryrefslogtreecommitdiffstats
path: root/src/compile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compile.cpp')
-rw-r--r--src/compile.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/compile.cpp b/src/compile.cpp
index 9a7162f..3918617 100644
--- a/src/compile.cpp
+++ b/src/compile.cpp
@@ -62,10 +62,9 @@ ACall::compile(CEnv& cenv)
CFunc f = c->impls.find(&fnT);
THROW_IF(!f, loc, (format("callee failed to compile for type %1%") % fnT.str()).str());
- vector<CVal> args(size() - 1);
- const_iterator e = begin() + 1;
- for (size_t i = 0; i < args.size(); ++i)
- args[i] = (*e++)->compile(cenv);
+ vector<CVal> args;
+ for (const_iterator e = begin() + 1; e != end(); ++e)
+ args.push_back((*e)->compile(cenv));
return cenv.engine()->compileCall(cenv, f, args);
}