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/tools/flood-tool.cpp | 2 +- src/ui/tools/freehand-base.cpp | 2 +- src/ui/tools/pencil-tool.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ui/tools') diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp index aaa5f1d9a..a6fc54f1f 100644 --- a/src/ui/tools/flood-tool.cpp +++ b/src/ui/tools/flood-tool.cpp @@ -869,7 +869,7 @@ static void sp_flood_do_flood_fill(ToolBase *event_context, GdkEvent *event, boo bci.current_step = 0; if (is_point_fill) { - fill_points.push_back(Geom::Point(event->button.x, event->button.y)); + fill_points.emplace_back(event->button.x, event->button.y); } else { Inkscape::Rubberband *r = Inkscape::Rubberband::get(desktop); fill_points = r->getPoints(); diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index ba2609975..6c8a3f2c3 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -274,7 +274,7 @@ static void spdc_apply_powerstroke_shape(std::vector points, Freeha if (!swidth) { swidth = swidth/2; } - points.push_back(Geom::Point(0, swidth)); + points.emplace_back(0, swidth); } Effect::createAndApply(POWERSTROKE, dc->desktop->doc(), item); lpe = SP_LPE_ITEM(item)->getCurrentLPE(); diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp index 842a84f74..f0d6639ab 100644 --- a/src/ui/tools/pencil-tool.cpp +++ b/src/ui/tools/pencil-tool.cpp @@ -809,7 +809,7 @@ PencilTool::addPowerStrokePencil() (_previous_pressure > step && pressure_shrunk < step)) { _previous_pressure = pressure_shrunk; - this->points.push_back(Geom::Point(0, pressure_computed)); + this->points.emplace_back(0, pressure_computed); this->_points_pos.push_back(this->_last_point); } if (this->_curve && this->ps.size() > 1) { -- cgit v1.2.3