diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-15 05:18:26 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-15 05:21:34 (GMT) |
commit | 4fb59e0a8d40083f545dd43a370bd6d7b7b4cd35 (patch) | |
tree | 54cdfa22619e446ed349e8c1486e6cea3e64c707 /src/network/bearer/qbearerengine.cpp | |
parent | 4089401868dd62972a750c3e668a2998071de97c (diff) | |
download | Qt-4fb59e0a8d40083f545dd43a370bd6d7b7b4cd35.zip Qt-4fb59e0a8d40083f545dd43a370bd6d7b7b4cd35.tar.gz Qt-4fb59e0a8d40083f545dd43a370bd6d7b7b4cd35.tar.bz2 |
Optimise iterations over QHash.
Diffstat (limited to 'src/network/bearer/qbearerengine.cpp')
-rw-r--r-- | src/network/bearer/qbearerengine.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/network/bearer/qbearerengine.cpp b/src/network/bearer/qbearerengine.cpp index bd2ca6c..58d64f2 100644 --- a/src/network/bearer/qbearerengine.cpp +++ b/src/network/bearer/qbearerengine.cpp @@ -50,22 +50,23 @@ QBearerEngine::QBearerEngine(QObject *parent) QBearerEngine::~QBearerEngine() { - foreach (const QString &oldIface, snapConfigurations.keys()) { - QNetworkConfigurationPrivatePointer priv = snapConfigurations.take(oldIface); - priv->isValid = false; - priv->id.clear(); + QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator it; + QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator end; + for (it = snapConfigurations.begin(), end = snapConfigurations.end(); it != end; ++it) { + it.value()->isValid = false; + it.value()->id.clear(); } - foreach (const QString &oldIface, accessPointConfigurations.keys()) { - QNetworkConfigurationPrivatePointer priv = accessPointConfigurations.take(oldIface); - priv->isValid = false; - priv->id.clear(); + for (it = accessPointConfigurations.begin(), end = accessPointConfigurations.end(); + it != end; ++it) { + it.value()->isValid = false; + it.value()->id.clear(); } - foreach (const QString &oldIface, userChoiceConfigurations.keys()) { - QNetworkConfigurationPrivatePointer priv = userChoiceConfigurations.take(oldIface); - priv->isValid = false; - priv->id.clear(); + for (it = userChoiceConfigurations.begin(), end = userChoiceConfigurations.end(); + it != end; ++it) { + it.value()->isValid = false; + it.value()->id.clear(); } } |