metadataengine/client/src/mdequery.cpp
changeset 23 33ae025ac1e8
parent 21 50bf9db68373
child 40 910a23996aa0
--- a/metadataengine/client/src/mdequery.cpp	Fri Apr 16 15:23:55 2010 +0300
+++ b/metadataengine/client/src/mdequery.cpp	Mon May 03 12:55:01 2010 +0300
@@ -409,10 +409,8 @@
         {
         iResults[firstNewItemIndex + i].iOwned = ETrue;
         }
-
-    const TInt observerCount = iObservers.Count();
     
-	for (i = 0; i < observerCount; i++)
+    for( TInt i = iObservers.Count() - 1; i >=0; i-- )
 		{
 		MMdEQueryObserver* observer = iObservers[i];
 		observer->HandleQueryNewResults( *this, firstNewItemIndex, newCount );
@@ -426,7 +424,6 @@
                     TMdEPanic::Panic(TMdEPanic::EInternal));
 
 	TInt firstNewItemIndex = iIdResults.Count();
-	TInt i = 0;
 
     const TInt oldCount = iIdResults.Count();
 
@@ -441,10 +438,8 @@
         // Leave with the same error.
         User::Leave(err);
         }
-
-    const TInt observerCount = iObservers.Count();
     
-	for (i = 0; i < observerCount; i++)
+    for( TInt i = iObservers.Count() - 1; i >=0; i-- )
 		{
 		MMdEQueryObserver* observer = iObservers[i];
 		observer->HandleQueryNewResults(*this, firstNewItemIndex, 
@@ -455,7 +450,6 @@
 void CMdEQuery::NotifyNewResultsL( const CDesCArray& aNewResults )
     {
 	TInt firstNewItemIndex = aNewResults.Count();
-	TInt i = 0;
 
 	TInt oldCount = 0;
 	if( iDistinctResults )
@@ -479,9 +473,7 @@
         User::Leave(err);
         }
 
-    const TInt observerCount = iObservers.Count();
-    
-	for (i = 0; i < observerCount; i++)
+    for( TInt i = iObservers.Count() - 1; i >=0; i-- )
 		{
 		MMdEQueryObserver* observer = iObservers[i];
 		observer->HandleQueryNewResults( *this, firstNewItemIndex,