From c6fcb8555f727604c2ca28b685129b29ca74e361 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 28 Jan 2015 13:16:09 +0100 Subject: [PATCH] Simplify FunctionType's Vardecl constructor --- Types.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Types.cpp b/Types.cpp index 812271e30..fcb10d4b5 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 paramNames; - TypePointers retParams; - vector retParamNames; + TypePointers params({}); + vector paramNames({}); + TypePointers retParams({_varDecl.getType()}); + vector 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);