mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Simplify FunctionType's Vardecl constructor
This commit is contained in:
parent
2947e038d2
commit
c6fcb8555f
15
Types.cpp
15
Types.cpp
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user