summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2019-10-04 17:42:31 +0200
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2019-10-07 09:24:35 +0200
commitfa4d01ae128dd5605910bafda580e856239e36c6 (patch)
treea745467f92bde5a940cf44dcc75106b78f60b6ed
parentb8382a4ac487c64a70796aa9d9016b5604ca9446 (diff)
downloadqtmultimedia-fa4d01ae128dd5605910bafda580e856239e36c6.tar.gz
Small performance improvements suggested by clang-tidy
* Add const & to function parameters * Add const & to variables assigned from functions returning const & Change-Id: Idc141bd48f37eae92a4d1775caade3c977a42391 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
-rw-r--r--src/gsttools/qgstutils.cpp2
-rw-r--r--src/plugins/alsa/qalsaaudiodeviceinfo.cpp2
-rw-r--r--src/plugins/alsa/qalsaaudiodeviceinfo.h2
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp4
-rw-r--r--src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp4
5 files changed, 7 insertions, 7 deletions
diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp
index ac8808115..f8a9d79c1 100644
--- a/src/gsttools/qgstutils.cpp
+++ b/src/gsttools/qgstutils.cpp
@@ -1309,7 +1309,7 @@ void QGstUtils::setMetaData(GstElement *element, const QMap<QByteArray, QVariant
for (auto it = data.cbegin(), end = data.cend(); it != end; ++it) {
const QString tagName = QString::fromLatin1(it.key());
- const QVariant tagValue = it.value();
+ const QVariant &tagValue = it.value();
switch (tagValue.type()) {
case QVariant::String:
diff --git a/src/plugins/alsa/qalsaaudiodeviceinfo.cpp b/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
index 5e8edc3fc..474fd6bde 100644
--- a/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
+++ b/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
@@ -54,7 +54,7 @@
QT_BEGIN_NAMESPACE
-QAlsaAudioDeviceInfo::QAlsaAudioDeviceInfo(QByteArray dev, QAudio::Mode mode)
+QAlsaAudioDeviceInfo::QAlsaAudioDeviceInfo(const QByteArray &dev, QAudio::Mode mode)
{
handle = 0;
diff --git a/src/plugins/alsa/qalsaaudiodeviceinfo.h b/src/plugins/alsa/qalsaaudiodeviceinfo.h
index 21e30f49b..65675df54 100644
--- a/src/plugins/alsa/qalsaaudiodeviceinfo.h
+++ b/src/plugins/alsa/qalsaaudiodeviceinfo.h
@@ -74,7 +74,7 @@ class QAlsaAudioDeviceInfo : public QAbstractAudioDeviceInfo
{
Q_OBJECT
public:
- QAlsaAudioDeviceInfo(QByteArray dev,QAudio::Mode mode);
+ QAlsaAudioDeviceInfo(const QByteArray &dev,QAudio::Mode mode);
~QAlsaAudioDeviceInfo();
bool testSettings(const QAudioFormat& format) const;
diff --git a/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp b/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp
index 98aaded72..1a35c5cf6 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp
@@ -205,8 +205,8 @@ GstElement *QGstreamerAudioEncode::createEncoder()
QMap<QString, QVariant> options = m_options.value(codec);
for (auto it = options.cbegin(), end = options.cend(); it != end; ++it) {
- QString option = it.key();
- QVariant value = it.value();
+ const QString &option = it.key();
+ const QVariant &value = it.value();
switch (value.type()) {
case QVariant::Int:
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp b/src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp
index 4cc0e5f25..a2ed1d288 100644
--- a/src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp
+++ b/src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp
@@ -196,8 +196,8 @@ GstElement *QGstreamerVideoEncode::createEncoder()
QMap<QString,QVariant> options = m_options.value(codec);
for (auto it = options.cbegin(), end = options.cend(); it != end; ++it) {
- QString option = it.key();
- QVariant value = it.value();
+ const QString &option = it.key();
+ const QVariant &value = it.value();
switch (value.type()) {
case QVariant::Int: