diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-02-29 01:01:50 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-02-29 10:35:02 +0000 |
commit | e484d72a00225ffd71c5dc356f66e2d73c06b823 (patch) | |
tree | 661ef3f174a806e2d95ca87e1dcf7d85dcb2c563 /src/core/resources | |
parent | f6f337aff7c78ed8192442e2062bc08a1a00c2b2 (diff) |
core: eradicate Q_FOREACH loops [low-risk]
... by replacing them with C++11 range-for loops. To
avoid detaches of these mutable Qt containers, wrap
the container in qAsConst(), where needed.
This is the batch with low-risk changes. They operate
on local containers or the loop body clearly does not
cause the container to change.
Saves 8.3KiB (2.8%) in text size on optimized GCC 5.3
Linux AMD64 builds.
Change-Id: I5fae547c8a3a0a4c5467b967da55470d353f0ba8
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/resources')
-rw-r--r-- | src/core/resources/qframeallocator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/resources/qframeallocator.cpp b/src/core/resources/qframeallocator.cpp index 47dc9e315..054a30b7d 100644 --- a/src/core/resources/qframeallocator.cpp +++ b/src/core/resources/qframeallocator.cpp @@ -110,7 +110,7 @@ int QFrameAllocator::allocatorPoolSize() const bool QFrameAllocator::isEmpty() const { Q_D(const QFrameAllocator); - Q_FOREACH (const QFixedFrameAllocator &allocator, d->m_allocatorPool) { + for (const QFixedFrameAllocator &allocator : d->m_allocatorPool) { if (!allocator.isEmpty()) return false; } @@ -121,7 +121,7 @@ uint QFrameAllocator::totalChunkCount() const { Q_D(const QFrameAllocator); uint chunkCount = 0; - foreach (const QFixedFrameAllocator& allocator, d->m_allocatorPool) + for (const QFixedFrameAllocator& allocator : d->m_allocatorPool) chunkCount += allocator.chunkCount(); return chunkCount; } @@ -218,7 +218,7 @@ void QFixedFrameAllocator::clear() bool QFixedFrameAllocator::isEmpty() const { - Q_FOREACH (const QFrameChunk &chunck, m_chunks) { + for (const QFrameChunk &chunck : m_chunks) { if (chunck.m_blocksAvailable != chunck.m_maxBlocksAvailable) return false; } |