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>
This commit is contained in:
Marc Mutz 2014-09-24 10:53:52 +02:00
parent 9bee41796b
commit 3759749466
2 changed files with 3 additions and 6 deletions

View File

@ -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;

View File

@ -155,7 +155,7 @@ public:
Q_SIGNALS:
void roamingAllowedChanged(bool);
private:
QVariantMap getProperties();
QVariantMap &getProperties();
QVariantMap propertiesMap;
QVariant getProperty(const QString &);
QStringList contextList;