summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-18 16:54:54 +0000
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-18 18:27:11 +0000
commit571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0 (patch)
tree95696a57d31908e2d5b5853b4c84e3d53c700db1 /src/util
parentUpdate pdf-parser.cpp (diff)
downloadinkscape-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/util')
-rw-r--r--src/util/ege-tags.cpp11
-rw-r--r--src/util/ege-tags.h4
-rw-r--r--src/util/units.cpp17
-rw-r--r--src/util/units.h8
-rw-r--r--src/util/ziptool.cpp9
-rw-r--r--src/util/ziptool.h4
6 files changed, 28 insertions, 25 deletions
diff --git a/src/util/ege-tags.cpp b/src/util/ege-tags.cpp
index 3b9f68df8..f3955129a 100644
--- a/src/util/ege-tags.cpp
+++ b/src/util/ege-tags.cpp
@@ -47,6 +47,7 @@
#include <set>
#include <algorithm>
#include <functional>
+#include <utility>
#include "ege-tags.h"
@@ -55,9 +56,9 @@
namespace ege
{
-Label::Label(std::string const& lang, std::string const& value) :
- lang(lang),
- value(value)
+Label::Label(std::string lang, std::string value) :
+ lang(std::move(lang)),
+ value(std::move(value))
{
}
@@ -69,8 +70,8 @@ Label::~Label()
Tag::~Tag()
= default;
-Tag::Tag(std::string const& key) :
- key(key)
+Tag::Tag(std::string key) :
+ key(std::move(key))
{
}
diff --git a/src/util/ege-tags.h b/src/util/ege-tags.h
index 7280e1f6a..a481c97e1 100644
--- a/src/util/ege-tags.h
+++ b/src/util/ege-tags.h
@@ -54,7 +54,7 @@ class Label
{
public:
Label();
- Label(std::string const& lang, std::string const& value);
+ Label(std::string lang, std::string value);
~Label();
std::string lang;
@@ -65,7 +65,7 @@ class Tag
{
public:
Tag();
- Tag(std::string const& key);
+ Tag(std::string key);
~Tag();
std::string key;
diff --git a/src/util/units.cpp b/src/util/units.cpp
index ffa2681c6..340d3f697 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -17,6 +17,7 @@
#include <cerrno>
#include <iomanip>
#include <iostream>
+#include <utility>
#include <glib.h>
#include <glibmm/regex.h>
#include <glibmm/fileutils.h>
@@ -164,16 +165,16 @@ Unit::Unit() :
Unit::Unit(UnitType type,
double factor,
- Glib::ustring const &name,
- Glib::ustring const &name_plural,
- Glib::ustring const &abbr,
- Glib::ustring const &description)
+ Glib::ustring name,
+ Glib::ustring name_plural,
+ Glib::ustring abbr,
+ Glib::ustring description)
: type(type)
, factor(factor)
- , name(name)
- , name_plural(name_plural)
- , abbr(abbr)
- , description(description)
+ , name(std::move(name))
+ , name_plural(std::move(name_plural))
+ , abbr(std::move(abbr))
+ , description(std::move(description))
{
g_return_if_fail(factor <= 0);
}
diff --git a/src/util/units.h b/src/util/units.h
index fa70058ba..e4530d0c3 100644
--- a/src/util/units.h
+++ b/src/util/units.h
@@ -43,10 +43,10 @@ public:
Unit();
Unit(UnitType type,
double factor,
- Glib::ustring const &name,
- Glib::ustring const &name_plural,
- Glib::ustring const &abbr,
- Glib::ustring const &description);
+ Glib::ustring name,
+ Glib::ustring name_plural,
+ Glib::ustring abbr,
+ Glib::ustring description);
void clear();
diff --git a/src/util/ziptool.cpp b/src/util/ziptool.cpp
index fe64bad6f..4408c3daa 100644
--- a/src/util/ziptool.cpp
+++ b/src/util/ziptool.cpp
@@ -36,6 +36,7 @@
#include <ctime>
#include <string>
+#include <utility>
#include "ziptool.h"
@@ -1903,11 +1904,11 @@ ZipEntry::ZipEntry() :
/**
*
*/
-ZipEntry::ZipEntry(const std::string &fileNameArg,
- const std::string &commentArg) :
+ZipEntry::ZipEntry(std::string fileNameArg,
+ std::string commentArg) :
crc (0L),
- fileName (fileNameArg),
- comment (commentArg),
+ fileName (std::move(fileNameArg)),
+ comment (std::move(commentArg)),
compressionMethod (8),
compressedData (),
uncompressedData (),
diff --git a/src/util/ziptool.h b/src/util/ziptool.h
index dbae8ac60..bcaec11f6 100644
--- a/src/util/ziptool.h
+++ b/src/util/ziptool.h
@@ -251,8 +251,8 @@ public:
/**
*
*/
- ZipEntry(const std::string &fileName,
- const std::string &comment);
+ ZipEntry(std::string fileName,
+ std::string comment);
/**
*