aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-28 20:16:09 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-29 04:46:16 +0800
commitc6fcb8555f727604c2ca28b685129b29ca74e361 (patch)
tree5e7bdd0ac39f12a43ac8e9f09f01f7289e2949c0 /Types.cpp
parent2947e038d28d3d732b1db352f71c8c9669df8eef (diff)
downloaddexon-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.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/Types.cpp b/Types.cpp
index 812271e3..fcb10d4b 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -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);