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/selection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index 66c960953..142695855 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -131,7 +131,7 @@ std::vector Selection::getSnapPoints(SnapPreferenc //Include the transformation origin for snapping //For a selection or group only the overall center is considered, not for each item individually if (snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_ROTATION_CENTER)) { - p.push_back(Inkscape::SnapCandidatePoint(this_item->getCenter(), SNAPSOURCE_ROTATION_CENTER)); + p.emplace_back(this_item->getCenter(), SNAPSOURCE_ROTATION_CENTER); } } } @@ -211,7 +211,7 @@ Selection::setBackup () selected_id += "--id="; selected_id += item->getId(); params.push_back(selected_id); - _selected_ids.push_back(item->getId()); + _selected_ids.emplace_back(item->getId()); } if(tool){ Inkscape::UI::ControlPointSelection *cps = tool->_selected_nodes; @@ -242,7 +242,7 @@ Selection::setBackup () Glib::ustring selected_nodes = ss.str(); if(found_nl && found_sp) { - _seldata.push_back(std::make_pair(id,std::make_pair(sp,nl))); + _seldata.emplace_back(id,std::make_pair(sp,nl)); params.push_back(selected_nodes); } else { g_warning("Something went wrong while trying to pass selected nodes to extension. Please report a bug."); -- cgit v1.2.3