diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-18 16:54:54 +0000 |
|---|---|---|
| committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-18 18:27:11 +0000 |
| commit | 571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0 (patch) | |
| tree | 95696a57d31908e2d5b5853b4c84e3d53c700db1 /src/display | |
| parent | Update pdf-parser.cpp (diff) | |
| download | inkscape-571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0.tar.gz inkscape-571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0.zip | |
Run clang-tidy’s modernize-pass-by-value pass.
This avoids having to pass variables by reference before copying them
when calling a constructor.
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/curve.cpp | 6 | ||||
| -rw-r--r-- | src/display/curve.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp index ca7666ee0..211eaaa53 100644 --- a/src/display/curve.cpp +++ b/src/display/curve.cpp @@ -19,6 +19,8 @@ #include <2geom/sbasis-to-bezier.h> #include <2geom/point.h> +#include <utility> + /** * Routines for SPCurve and for its Geom::PathVector */ @@ -33,9 +35,9 @@ SPCurve::SPCurve() _pathv() {} -SPCurve::SPCurve(Geom::PathVector const& pathv) +SPCurve::SPCurve(Geom::PathVector pathv) : _refcount(1), - _pathv(pathv) + _pathv(std::move(pathv)) {} //concat constructor diff --git a/src/display/curve.h b/src/display/curve.h index b79d41ebe..0e6a0ec86 100644 --- a/src/display/curve.h +++ b/src/display/curve.h @@ -25,7 +25,7 @@ class SPCurve { public: /* Constructors */ explicit SPCurve(); - explicit SPCurve(Geom::PathVector const& pathv); + explicit SPCurve(Geom::PathVector pathv); explicit SPCurve(std::list<SPCurve *> const& pathv); static SPCurve * new_from_rect(Geom::Rect const &rect, bool all_four_sides = false); |
