summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-09-24 10:53:52 +0200
committerMarc Mutz <marc.mutz@kdab.com>2014-10-02 16:00:32 +0200
commit37597494666e6968ba7b2d946cdaf357069ec0b3 (patch)
treec116c18691e9dd847cc13fc85743a84b7f93ab16 /src/plugins/bearer
parent9bee41796b24b5857bfa43e09840522c9352e02a (diff)
Simplify QOfonoDataConnectionManagerInterface::getProperty()
Make getProperties() return a reference and directly call value() on it. Almost is a tail-call now, if it wasn't inlined and if the dtor of the default argument didn't have to be called. Saves 288bytes in text size even so. Change-Id: Ie841501c1ce1379ca928f7474b90bc6487d77ab2 Reviewed-by: Valerio Valerio <valerio.valerio@jollamobile.com> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins/bearer')
-rw-r--r--src/plugins/bearer/connman/qofonoservice_linux.cpp7
-rw-r--r--src/plugins/bearer/connman/qofonoservice_linux_p.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/bearer/connman/qofonoservice_linux.cpp b/src/plugins/bearer/connman/qofonoservice_linux.cpp
index ecf79101f0..fdd8a9c8d5 100644
--- a/src/plugins/bearer/connman/qofonoservice_linux.cpp
+++ b/src/plugins/bearer/connman/qofonoservice_linux.cpp
@@ -272,13 +272,10 @@ bool QOfonoDataConnectionManagerInterface::roamingAllowed()
QVariant QOfonoDataConnectionManagerInterface::getProperty(const QString &property)
{
- QVariant var;
- QVariantMap map = getProperties();
- var = map.value(property);
- return var;
+ return getProperties().value(property);
}
-QVariantMap QOfonoDataConnectionManagerInterface::getProperties()
+QVariantMap &QOfonoDataConnectionManagerInterface::getProperties()
{
if (propertiesMap.isEmpty()) {
QList<QVariant> argumentList;
diff --git a/src/plugins/bearer/connman/qofonoservice_linux_p.h b/src/plugins/bearer/connman/qofonoservice_linux_p.h
index f2d9e5351b..302d7543d4 100644
--- a/src/plugins/bearer/connman/qofonoservice_linux_p.h
+++ b/src/plugins/bearer/connman/qofonoservice_linux_p.h
@@ -155,7 +155,7 @@ public:
Q_SIGNALS:
void roamingAllowedChanged(bool);
private:
- QVariantMap getProperties();
+ QVariantMap &getProperties();
QVariantMap propertiesMap;
QVariant getProperty(const QString &);
QStringList contextList;