diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-28 20:16:09 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-29 04:46:16 +0800 |
commit | c6fcb8555f727604c2ca28b685129b29ca74e361 (patch) | |
tree | 5e7bdd0ac39f12a43ac8e9f09f01f7289e2949c0 /Types.cpp | |
parent | 2947e038d28d3d732b1db352f71c8c9669df8eef (diff) | |
download | dexon-solidity-c6fcb8555f727604c2ca28b685129b29ca74e361.tar.gz dexon-solidity-c6fcb8555f727604c2ca28b685129b29ca74e361.tar.zst dexon-solidity-c6fcb8555f727604c2ca28b685129b29ca74e361.zip |
Simplify FunctionType's Vardecl constructor
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -608,17 +608,12 @@ FunctionType::FunctionType(FunctionDefinition const& _function, bool _isInternal FunctionType::FunctionType(VariableDeclaration const& _varDecl): m_location(Location::EXTERNAL) { - TypePointers params; - vector<string> paramNames; - TypePointers retParams; - vector<string> retParamNames; + TypePointers params({}); + vector<string> paramNames({}); + TypePointers retParams({_varDecl.getType()}); + vector<string> retParamNames({ _varDecl.getName()}); // for now, no input parameters LTODO: change for some things like mapping - params.reserve(0); - paramNames.reserve(0); - retParams.reserve(1); - retParamNames.reserve(1); - retParams.push_back(_varDecl.getType()); - retParamNames.push_back(_varDecl.getName()); + swap(params, m_parameterTypes); swap(paramNames, m_parameterNames); swap(retParams, m_returnParameterTypes); |