use foreach() for iteration in QDirIteratorPrivate::matchesFilters()

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2020-01-05 22:10:48 +00:00
parent e7d17d4d43
commit a18cf42a18

View file

@ -318,18 +318,12 @@ bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInf
#ifndef QT_NO_REGEXP
// Pass all entries through name filters, except dirs if the AllDirs
if (!nameFilters.isEmpty() && !((filters & QDir::AllDirs) && fi.isDir())) {
bool matched = false;
for (QVector<QRegExp>::const_iterator iter = nameRegExps.constBegin(),
end = nameRegExps.constEnd();
iter != end; ++iter) {
if (iter->exactMatch(fileName)) {
matched = true;
break;
foreach (const QRegExp iter, nameRegExps) {
if (iter.exactMatch(fileName)) {
return true;
}
}
if (!matched)
return false;
return false;
}
#endif
// skip symlinks