From fcf93adf1e766fbc69b05e598ee0aeb9b36b1c70 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 18 Jun 2018 21:48:07 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-use-emplace=20pa?= =?UTF-8?q?ss.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reduces the boilerplate required to add a new element to a container. --- src/libnrtype/FontFactory.cpp | 2 +- src/libnrtype/Layout-TNG-Input.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libnrtype') diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index eac18a76e..99717bb77 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -453,7 +453,7 @@ void font_factory::GetUIFamilies(std::vector& out) std::cerr << "Ignoring font '" << displayName << "'" << std::endl; continue; } - sorted.push_back(std::make_pair(families[currentFamily], displayName)); + sorted.emplace_back(families[currentFamily], displayName); } std::sort(sorted.begin(), sorted.end(), ustringPairSort); diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp index c5ea9b03a..7101ee063 100644 --- a/src/libnrtype/Layout-TNG-Input.cpp +++ b/src/libnrtype/Layout-TNG-Input.cpp @@ -117,7 +117,7 @@ void Layout::appendControlCode(TextControlCode code, void *source_cookie, double // more saving of the parameters void Layout::appendWrapShape(Shape const *shape, DisplayAlign display_align) { - _input_wrap_shapes.push_back(InputWrapShape()); + _input_wrap_shapes.emplace_back(); _input_wrap_shapes.back().shape = shape; _input_wrap_shapes.back().display_align = display_align; } -- cgit v1.2.3