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/ui/tool/path-manipulator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/tool/path-manipulator.cpp') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index ce4a02a2b..2369a75d4 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -295,11 +295,11 @@ add_or_replace_if_extremum(std::vector< std::pair > if (testvalue > extrvalue) { // replace all extreme nodes with the new one vec.clear(); - vec.push_back( std::pair( node, t ) ); + vec.emplace_back( node, t ); extrvalue = testvalue; } else if ( Geom::are_near(testvalue, extrvalue) ) { // very rare but: extremum node at the same extreme value!!! so add it to the list - vec.push_back( std::pair( node, t ) ); + vec.emplace_back( node, t ); } } -- cgit v1.2.3