summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-07-16 19:22:04 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-07-22 12:36:17 (GMT)
commit3da795b77f3bb0752eb14057086241f25293e26d (patch)
tree96af71ee73cd79d088a8077279e1eac800dd4460 /src
parent4c58b5936b6d169f6745d5eea3e65744956b8d92 (diff)
downloadQt-3da795b77f3bb0752eb14057086241f25293e26d.zip
Qt-3da795b77f3bb0752eb14057086241f25293e26d.tar.gz
Qt-3da795b77f3bb0752eb14057086241f25293e26d.tar.bz2
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
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdiriterator.cpp3
1 files changed, 1 insertions, 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();
}