aboutsummaryrefslogtreecommitdiffstats
path: root/src/compile.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-08-22 19:16:28 +0000
committerDavid Robillard <d@drobilla.net>2010-08-22 19:16:28 +0000
commitb4dba561084b7ce60a8b1cfdb4e3b9de87de8d35 (patch)
tree4bdd431a1af0885a27c4c4c582bd721862629a84 /src/compile.cpp
parent6f63ae0e3e9af059c7cac3d3a29e4fb34b0b0e28 (diff)
downloadresp-b4dba561084b7ce60a8b1cfdb4e3b9de87de8d35.tar.gz
resp-b4dba561084b7ce60a8b1cfdb4e3b9de87de8d35.tar.bz2
resp-b4dba561084b7ce60a8b1cfdb4e3b9de87de8d35.zip
Simplify Engine::startFunction.
git-svn-id: http://svn.drobilla.net/resp/resp@267 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/compile.cpp')
-rw-r--r--src/compile.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compile.cpp b/src/compile.cpp
index 7a875f3..66c3abe 100644
--- a/src/compile.cpp
+++ b/src/compile.cpp
@@ -64,11 +64,12 @@ AFn::compile(CEnv& cenv) const throw()
{
const AType* type = cenv.type(this);
CFunc f = cenv.findImpl(this, type);
- if (!f) {
- f = cenv.engine()->compileFunction(cenv, this, type);
- cenv.vals.def(cenv.penv.sym(name), f);
- cenv.addImpl(this, f);
- }
+ if (f)
+ return f;
+
+ f = cenv.engine()->compileFunction(cenv, this, type);
+ cenv.vals.def(cenv.penv.sym(name), f);
+ cenv.addImpl(this, f);
return f;
}