From 4c09f8e087cae598efbb78759110c03ed10e3a3a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 8 Sep 2017 16:55:37 +0200 Subject: clang-tidy modernize-use-emplace in c* Change-Id: I419d1f67ba301050d05981db2a3d6178878684a9 Reviewed-on: https://gerrit.libreoffice.org/42110 Tested-by: Jenkins Reviewed-by: Noel Grandin --- codemaker/source/javamaker/javaoptions.cxx | 4 ++-- codemaker/source/javamaker/javatype.cxx | 17 +++++++---------- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'codemaker/source/javamaker') diff --git a/codemaker/source/javamaker/javaoptions.cxx b/codemaker/source/javamaker/javaoptions.cxx index 08c5a7f4dbf8..19818f8143be 100644 --- a/codemaker/source/javamaker/javaoptions.cxx +++ b/codemaker/source/javamaker/javaoptions.cxx @@ -177,7 +177,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) s = av[i] + 2; } - m_extra_input_files.push_back( s ); + m_extra_input_files.emplace_back(s ); break; } @@ -215,7 +215,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) } } else { - m_inputFiles.push_back(av[i]); + m_inputFiles.emplace_back(av[i]); } } } diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index f2ce8454ef26..8ca5b7190ca2 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -786,7 +786,7 @@ void handleEnumType( std::unique_ptr< ClassFile::Code > blockCode(cf->newCode()); blockCode->instrGetstatic(className, pair.second, classDescriptor); blockCode->instrAreturn(); - blocks.push_back(std::make_pair(pair.first, blockCode.get())); + blocks.emplace_back(pair.first, blockCode.get()); blockCode.release(); } code->instrLookupswitch(defCode.get(), blocks); @@ -1908,13 +1908,12 @@ void handleInterfaceType( "set" + attrName, sdesc.getDescriptor(), nullptr, exc2, sdesc.getSignature()); } - typeInfo.push_back( - TypeInfo( + typeInfo.emplace_back( TypeInfo::KIND_ATTRIBUTE, attrName, specialType, static_cast< TypeInfo::Flags >( (attr.readOnly ? TypeInfo::FLAG_READONLY : 0) | (attr.bound ? TypeInfo::FLAG_BOUND : 0)), - index, polymorphicUnoType)); + index, polymorphicUnoType); index += (attr.readOnly ? 1 : 2); } for (const unoidl::InterfaceTypeEntity::Method& method : entity->getDirectMethods()) @@ -1925,11 +1924,10 @@ void handleInterfaceType( MethodDescriptor desc( manager, dependencies, method.returnType, &specialReturnType, &polymorphicUnoReturnType); - typeInfo.push_back( - TypeInfo( + typeInfo.emplace_back( TypeInfo::KIND_METHOD, methodName, specialReturnType, static_cast< TypeInfo::Flags >(0), index++, - polymorphicUnoReturnType)); + polymorphicUnoReturnType); sal_Int32 paramIndex = 0; for (const unoidl::InterfaceTypeEntity::Method::Parameter& param : method.parameters) { @@ -1943,10 +1941,9 @@ void handleInterfaceType( if (out || isSpecialType(specialType) || polymorphicUnoType.kind != PolymorphicUnoType::KIND_NONE) { - typeInfo.push_back( - TypeInfo( + typeInfo.emplace_back( codemaker::convertString(param.name), specialType, in, - out, methodName, paramIndex, polymorphicUnoType)); + out, methodName, paramIndex, polymorphicUnoType); } ++paramIndex; } -- cgit