Simplify FunctionType's Vardecl constructor

This commit is contained in:
Lefteris Karapetsas 2015-01-28 13:16:09 +01:00
parent 2947e038d2
commit c6fcb8555f

View File

@ -608,17 +608,12 @@ FunctionType::FunctionType(FunctionDefinition const& _function, bool _isInternal
FunctionType::FunctionType(VariableDeclaration const& _varDecl): FunctionType::FunctionType(VariableDeclaration const& _varDecl):
m_location(Location::EXTERNAL) m_location(Location::EXTERNAL)
{ {
TypePointers params; TypePointers params({});
vector<string> paramNames; vector<string> paramNames({});
TypePointers retParams; TypePointers retParams({_varDecl.getType()});
vector<string> retParamNames; vector<string> retParamNames({ _varDecl.getName()});
// for now, no input parameters LTODO: change for some things like mapping // 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(params, m_parameterTypes);
swap(paramNames, m_parameterNames); swap(paramNames, m_parameterNames);
swap(retParams, m_returnParameterTypes); swap(retParams, m_returnParameterTypes);