From 800dda19a611339863aa5cfe6da13bc235d68e68 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 15 Jan 2020 23:00:58 +0100 Subject: Do not anchor an already-anchored regexp wildcardToRegularExpression() returns an anchored regexp, so it is pointless to anchor it again. Change-Id: If470179d63ae7ca2e7f137c0f403ec5bb5be8aaf Task-number: QTBUG-81396 Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qdiriterator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index ce436b06e3..1cf6b1be08 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -181,7 +181,7 @@ QDirIteratorPrivate::QDirIteratorPrivate(const QFileSystemEntry &entry, const QS #elif QT_CONFIG(regularexpression) nameRegExps.reserve(nameFilters.size()); for (const auto &filter : nameFilters) { - QString re = QRegularExpression::anchoredPattern(QRegularExpression::wildcardToRegularExpression(filter)); + QString re = QRegularExpression::wildcardToRegularExpression(filter); nameRegExps.append( QRegularExpression(re, (filters & QDir::CaseSensitive) ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption)); } -- cgit v1.2.3