QDirIterator: make a confusing condition less so

The old code checked for non-empty-ness before asking whether it
contains a certain path. But an empty container cannot contain any
path.

Simply remove the isEmpty() check.

Change-Id: Ie40279a8db4900c2f7892c2a058206d622565b10
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2020-05-02 22:50:51 +02:00
parent 74306a02ce
commit e62f6ffcb3

View File

@ -319,8 +319,7 @@ void QDirIteratorPrivate::checkAndPushDirectory(const QFileInfo &fileInfo)
return; return;
// Stop link loops // Stop link loops
if (!visitedLinks.isEmpty() && if (visitedLinks.contains(fileInfo.canonicalFilePath()))
visitedLinks.contains(fileInfo.canonicalFilePath()))
return; return;
pushDirectory(fileInfo); pushDirectory(fileInfo);