aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerStack.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2014-12-03 00:18:09 +0800
committerLefteris Karapetsas <lefteris@refu.co>2014-12-03 00:18:09 +0800
commit06998aa2d22b4d40fd9d5ad713f249252544ce8e (patch)
treee961a6191c9755340ba9532896a798fadb31718c /CompilerStack.cpp
parentaf9fb9917c338522d1949e2767c9709c770b2879 (diff)
downloaddexon-solidity-06998aa2d22b4d40fd9d5ad713f249252544ce8e.tar
dexon-solidity-06998aa2d22b4d40fd9d5ad713f249252544ce8e.tar.gz
dexon-solidity-06998aa2d22b4d40fd9d5ad713f249252544ce8e.tar.bz2
dexon-solidity-06998aa2d22b4d40fd9d5ad713f249252544ce8e.tar.lz
dexon-solidity-06998aa2d22b4d40fd9d5ad713f249252544ce8e.tar.xz
dexon-solidity-06998aa2d22b4d40fd9d5ad713f249252544ce8e.tar.zst
dexon-solidity-06998aa2d22b4d40fd9d5ad713f249252544ce8e.zip
Simplifying lambda function in CompilerStack::getInterface()
Diffstat (limited to 'CompilerStack.cpp')
-rw-r--r--CompilerStack.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp
index 48a37b9c..e44a10fb 100644
--- a/CompilerStack.cpp
+++ b/CompilerStack.cpp
@@ -100,24 +100,22 @@ string const& CompilerStack::getInterface()
Json::Value inputs(Json::arrayValue);
Json::Value outputs(Json::arrayValue);
- auto streamVariables = [&](vector<ASTPointer<VariableDeclaration>> const& _vars,
- Json::Value &json)
+ auto streamVariables = [](vector<ASTPointer<VariableDeclaration>> const& _vars)
{
+ Json::Value params(Json::arrayValue);
for (ASTPointer<VariableDeclaration> const& var: _vars)
{
Json::Value input;
input["name"] = var->getName();
input["type"] = var->getType()->toString();
- json.append(input);
+ params.append(input);
}
+ return params;
};
method["name"] = f->getName();
- streamVariables(f->getParameters(), inputs);
- method["inputs"] = inputs;
- streamVariables(f->getReturnParameters(), outputs);
- method["outputs"] = outputs;
-
+ method["inputs"] = streamVariables(f->getParameters());
+ method["outputs"] = streamVariables(f->getReturnParameters());
methods.append(method);
}
m_interface = writer.write(methods);