QtGui: eradicate Q_FOREACH loops [QVarLengthArray]
Q_FOREACH over a QVarLengthArray is a partcularly bad idea. Use C++11 range-for (without qAsConst(), because QVLA isn't CoW). Change-Id: I5ee55557577f183151d3871e4518382c4adf0237 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
parent
2523f62939
commit
3ff5251740
@ -1276,9 +1276,9 @@ void QOpenGLDebugLoggerPrivate::controlDebugMessages(QOpenGLDebugMessage::Source
|
||||
// Unfortunately, some bugged drivers do NOT ignore it, so pass NULL in case.
|
||||
const GLuint * const idPtr = idCount ? ids.constData() : 0;
|
||||
|
||||
foreach (GLenum source, glSources)
|
||||
foreach (GLenum type, glTypes)
|
||||
foreach (GLenum severity, glSeverities)
|
||||
for (GLenum source : glSources)
|
||||
for (GLenum type : glTypes)
|
||||
for (GLenum severity : glSeverities)
|
||||
glDebugMessageControl(source, type, severity, idCount, idPtr, GLboolean(enable));
|
||||
}
|
||||
|
||||
|
@ -3040,7 +3040,7 @@ void QTextEngine::resolveFormats() const
|
||||
format = collection->charFormat(formatIndex(si));
|
||||
}
|
||||
if (!currentFormats.isEmpty()) {
|
||||
foreach (int cur, currentFormats) {
|
||||
for (int cur : currentFormats) {
|
||||
const QTextLayout::FormatRange &range = specialData->formats.at(cur);
|
||||
Q_ASSERT(range.start <= si->position && range.start + range.length >= end);
|
||||
format.merge(range.format);
|
||||
|
Loading…
Reference in New Issue
Block a user