From 3da795b77f3bb0752eb14057086241f25293e26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 16 Jul 2009 21:22:04 +0200 Subject: QDirIterator: Cleaning up after one's self Well, why not? Resetting nextFileInfo when we're done allows removing unnecessary check in QDirIterator::next(), while retaining behavior. Reviewed-by: Marius Storm-Olsen --- src/corelib/io/qdiriterator.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index 2e8d9c4..09001c6 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -205,6 +205,7 @@ void QDirIteratorPrivate::advance() } currentFileInfo = nextFileInfo; + nextFileInfo = QFileInfo(); } /*! @@ -440,8 +441,6 @@ QDirIterator::~QDirIterator() */ QString QDirIterator::next() { - if (!hasNext()) - return QString(); d->advance(); return filePath(); } -- cgit v0.12