aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2019-03-11 23:37:25 +0100
committerAlbert Astals Cid <aacid@kde.org>2019-03-11 23:37:31 +0100
commit7e55f08343ef888dbdcd7a521f437102f95681ab (patch)
treedb55ece64a89a8cbce5c2a47a7a357585751f9db /src
parent5a2ca3652ff6deb450470f95863bfbff7c3da00d (diff)
downloadkconfig-7e55f08343ef888dbdcd7a521f437102f95681ab.tar.gz
kconfig-7e55f08343ef888dbdcd7a521f437102f95681ab.tar.bz2
Remove reference from const KConfigIniBackend::BufferFragment &
Summary: According to clazy since KConfigIniBackend::BufferFragment is very small it's faster to just copy it Reviewers: apol Reviewed By: apol Subscribers: apol, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D19666
Diffstat (limited to 'src')
-rw-r--r--src/core/bufferfragment_p.h4
-rw-r--r--src/core/kconfigini.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/bufferfragment_p.h b/src/core/bufferfragment_p.h
index bbc09a2b..b4aff92a 100644
--- a/src/core/bufferfragment_p.h
+++ b/src/core/bufferfragment_p.h
@@ -150,7 +150,7 @@ public:
return (other.size() != (int)len || memcmp(d, other.constData(), len) != 0);
}
- bool operator==(const BufferFragment &other) const
+ bool operator==(const BufferFragment other) const
{
return other.len == len && !memcmp(d, other.d, len);
}
@@ -195,7 +195,7 @@ private:
unsigned int len;
};
-uint qHash(const KConfigIniBackend::BufferFragment &fragment)
+uint qHash(const KConfigIniBackend::BufferFragment fragment)
{
const uchar *p = reinterpret_cast<const uchar*>(fragment.constData());
const int len = fragment.length();
diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp
index 26d8390c..af306502 100644
--- a/src/core/kconfigini.cpp
+++ b/src/core/kconfigini.cpp
@@ -44,7 +44,7 @@
KCONFIGCORE_EXPORT bool kde_kiosk_exception = false; // flag to disable kiosk restrictions
-static QByteArray lookup(const KConfigIniBackend::BufferFragment &fragment, QHash<KConfigIniBackend::BufferFragment, QByteArray> *cache)
+static QByteArray lookup(const KConfigIniBackend::BufferFragment fragment, QHash<KConfigIniBackend::BufferFragment, QByteArray> *cache)
{
auto it = cache->constFind(fragment);
if (it != cache->constEnd()) {