diff options
author | João Abecasis <joao@abecasis.name> | 2009-07-22 11:08:45 (GMT) |
---|---|---|
committer | João Abecasis <joao@abecasis.name> | 2009-07-22 12:36:18 (GMT) |
commit | 90a3286841255132c96a2481a76c8b80c0728750 (patch) | |
tree | 390a52d8c63707b320c04fb04bbce3d43fd18f22 | |
parent | e3821cbae6f961a0e3a44f0863a3fd3424b540ba (diff) | |
download | Qt-90a3286841255132c96a2481a76c8b80c0728750.zip Qt-90a3286841255132c96a2481a76c8b80c0728750.tar.gz Qt-90a3286841255132c96a2481a76c8b80c0728750.tar.bz2 |
Bugfix/optimization in QResourceFileEngineIterator
If the resource is valid, children should not be empty. If it happens to
be, hasNext() should then return false. Setting the index to 0 ensures
this and also that we don't keep trying the same thing over and over.
Reviewed-by: Olivier Goffart
-rw-r--r-- | src/corelib/io/qresource_iterator.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/io/qresource_iterator.cpp b/src/corelib/io/qresource_iterator.cpp index 025fccf..7e22600 100644 --- a/src/corelib/io/qresource_iterator.cpp +++ b/src/corelib/io/qresource_iterator.cpp @@ -75,8 +75,7 @@ bool QResourceFileEngineIterator::hasNext() const // Initialize and move to the next entry. QResourceFileEngineIterator *that = const_cast<QResourceFileEngineIterator *>(this); that->entries = resource.children(); - if (!that->entries.isEmpty()) - that->index = 0; + that->index = 0; } return index < entries.size(); |