From 6926e0d4843715fb373002ac8c39cfde648e76c1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 23 Dec 2015 00:15:30 +0100 Subject: QtCore: eradicate all Q_FOREACH loops [kernel] Saves just 168b in text size on optimized GCC 4.9 Linux AMD64 builds, but most for loops are in non-Linux code. Change-Id: I4f20a65c2e4953011308ff831c9e8fa37a25274b Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcfsocketnotifier.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/kernel/qcfsocketnotifier.cpp') diff --git a/src/corelib/kernel/qcfsocketnotifier.cpp b/src/corelib/kernel/qcfsocketnotifier.cpp index 7f4c26d978..62272c1bca 100644 --- a/src/corelib/kernel/qcfsocketnotifier.cpp +++ b/src/corelib/kernel/qcfsocketnotifier.cpp @@ -235,7 +235,7 @@ void QCFSocketNotifier::unregisterSocketNotifier(QSocketNotifier *notifier) void QCFSocketNotifier::removeSocketNotifiers() { // Remove CFSockets from the runloop. - foreach (MacSocketInfo *socketInfo, macSockets) { + for (MacSocketInfo *socketInfo : qAsConst(macSockets)) { unregisterSocketInfo(socketInfo); delete socketInfo; } @@ -272,9 +272,9 @@ void QCFSocketNotifier::enableSocketNotifiers(CFRunLoopObserverRef ref, CFRunLoo Q_UNUSED(ref); Q_UNUSED(activity); - QCFSocketNotifier *that = static_cast(info); + const QCFSocketNotifier *that = static_cast(info); - foreach (MacSocketInfo *socketInfo, that->macSockets) { + for (MacSocketInfo *socketInfo : that->macSockets) { if (!CFSocketIsValid(socketInfo->socket)) continue; -- cgit v1.2.3