From 0d19a571cd5d5b031a91a4a3b4ad0a380989c47a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 26 Jan 2016 14:38:54 +0100 Subject: Android: eradicate Q_FOREACH loops [rvalues] ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: Ia086b1f3d072dd56c3545780490be03346df2880 Reviewed-by: BogDan Vatra --- src/plugins/bearer/android/src/qandroidbearerengine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/bearer') diff --git a/src/plugins/bearer/android/src/qandroidbearerengine.cpp b/src/plugins/bearer/android/src/qandroidbearerengine.cpp index e7a1d2b5fb..a43ed69570 100644 --- a/src/plugins/bearer/android/src/qandroidbearerengine.cpp +++ b/src/plugins/bearer/android/src/qandroidbearerengine.cpp @@ -275,7 +275,8 @@ void QAndroidBearerEngine::updateConfigurations() interfaces = QNetworkInterface::allInterfaces(); // Create a configuration for each of the main types (WiFi, Mobile, Bluetooth, WiMax, Ethernet) - foreach (const AndroidNetworkInfo &netInfo, m_connectivityManager->getAllNetworkInfo()) { + const auto netInfos = m_connectivityManager->getAllNetworkInfo(); + for (const AndroidNetworkInfo &netInfo : netInfos) { if (!netInfo.isValid()) continue; -- cgit v1.2.3