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/livarot/Path.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/livarot') diff --git a/src/livarot/Path.cpp b/src/livarot/Path.cpp index 5fa418968..a43bc3769 100644 --- a/src/livarot/Path.cpp +++ b/src/livarot/Path.cpp @@ -416,7 +416,7 @@ int Path::AddPoint(Geom::Point const &iPt, bool mvto) } int const n = pts.size(); - pts.push_back(path_lineto(mvto ? polyline_moveto : polyline_lineto, iPt)); + pts.emplace_back(mvto ? polyline_moveto : polyline_lineto, iPt); return n; } @@ -444,7 +444,7 @@ int Path::AddPoint(Geom::Point const &iPt, int ip, double it, bool mvto) } int const n = pts.size(); - pts.push_back(path_lineto(mvto ? polyline_moveto : polyline_lineto, iPt, ip, it)); + pts.emplace_back(mvto ? polyline_moveto : polyline_lineto, iPt, ip, it); return n; } @@ -459,7 +459,7 @@ int Path::AddForcedPoint(Geom::Point const &iPt) } int const n = pts.size(); - pts.push_back(path_lineto(polyline_forced, pts[n - 1].p)); + pts.emplace_back(polyline_forced, pts[n - 1].p); return n; } @@ -476,7 +476,7 @@ int Path::AddForcedPoint(Geom::Point const &iPt, int /*ip*/, double /*it*/) } int const n = pts.size(); - pts.push_back(path_lineto(polyline_forced, pts[n - 1].p, pts[n - 1].piece, pts[n - 1].t)); + pts.emplace_back(polyline_forced, pts[n - 1].p, pts[n - 1].piece, pts[n - 1].t); return n; } -- cgit v1.2.3