From b0de7bc428aaf914a836da3c33b123e4195e603e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 31 Aug 2017 12:05:39 +0200 Subject: clang-tidy modernize-use-emplace in various Change-Id: Id1bbd3f380c17beeaab11f7140d4df1304c3d0d8 Reviewed-on: https://gerrit.libreoffice.org/41750 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmlreader/source/xmlreader.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'xmlreader/source') diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx index 1c6bc45bb339..d6fe61f8363f 100644 --- a/xmlreader/source/xmlreader.cxx +++ b/xmlreader/source/xmlreader.cxx @@ -86,8 +86,8 @@ XmlReader::XmlReader(OUString const & fileUrl) throw css::uno::RuntimeException( "cannot mmap " + fileUrl_ + " (" + OUString::number(e) + ")" ); } - namespaceIris_.push_back(Span("http://www.w3.org/XML/1998/namespace")); - namespaces_.push_back(NamespaceData(Span("xml"), NAMESPACE_XML)); + namespaceIris_.emplace_back("http://www.w3.org/XML/1998/namespace"); + namespaces_.emplace_back(Span("xml"), NAMESPACE_XML); pos_ = static_cast< char * >(fileAddress_); end_ = pos_ + fileSize_; state_ = State::Content; @@ -120,7 +120,7 @@ int XmlReader::registerNamespaceIri(Span const & iri) { // those files during migration would fail without this hack that can be // removed once migration is no longer relevant (see // configmgr::Components::parseModificationLayer): - namespaces_.push_back(NamespaceData(Span("xsi"), id)); + namespaces_.emplace_back(Span("xsi"), id); } return id; } @@ -646,15 +646,13 @@ XmlReader::Result XmlReader::handleStartTag(int * nsId, Span * localName) { Span(attrNameBegin, attrNameColon - attrNameBegin).equals( "xmlns")) { - namespaces_.push_back( - NamespaceData( + namespaces_.emplace_back( Span(attrNameColon + 1, attrNameEnd - (attrNameColon + 1)), - scanNamespaceIri(valueBegin, valueEnd))); + scanNamespaceIri(valueBegin, valueEnd)); } else { - attributes_.push_back( - AttributeData( + attributes_.emplace_back( attrNameBegin, attrNameEnd, attrNameColon, valueBegin, - valueEnd)); + valueEnd); } } if (!hasDefaultNs && !elements_.empty()) { -- cgit