From 90a3286841255132c96a2481a76c8b80c0728750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 22 Jul 2009 13:08:45 +0200 Subject: 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 --- src/corelib/io/qresource_iterator.cpp | 3 +-- 1 file changed, 1 insertion(+), 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(this); that->entries = resource.children(); - if (!that->entries.isEmpty()) - that->index = 0; + that->index = 0; } return index < entries.size(); -- cgit v0.12