metadataengine/client/src/mdelogiccondition.cpp
changeset 21 50bf9db68373
parent 20 6dfc5f825351
--- a/metadataengine/client/src/mdelogiccondition.cpp	Fri Mar 19 09:38:01 2010 +0200
+++ b/metadataengine/client/src/mdelogiccondition.cpp	Fri Apr 16 15:23:55 2010 +0300
@@ -111,10 +111,8 @@
     // Base class locking.
     CMdECondition::SetLocked(aLocked);    
     
-    const TInt count = iChildren.Count();
-    
     // Lock children as well.
-    for(TInt i = 0; i < count; ++i)
+    for( TInt i = iChildren.Count()- 1; i >=0; i-- )
         {
         iChildren[i]->SetLocked(aLocked);
         }
@@ -122,10 +120,8 @@
 
 TUint32 CMdELogicCondition::InternalQueryOptimizationFlags(TUint32& aFlags)
 	{
-	const TInt count = iChildren.Count();
-	
 	// get flag from childrens
-	for( TInt i = 0 ; i < count; i++)
+	for( TInt i = iChildren.Count() - 1; i >=0; i-- )
 		{
 		iOptimizationFlags |= iChildren[i]->InternalQueryOptimizationFlags(aFlags);
 		}
@@ -144,7 +140,7 @@
 	bufferSize += count * CMdCSerializationBuffer::KRequiredSizeForTUint32;
 
 	// Required size for childrens
-	for( TInt i = 0 ; i < count; i++)
+	for( TInt i = count - 1; i >=0; i-- )
 		{
 		bufferSize += iChildren[i]->RequiredBufferSize();
 		}
@@ -338,8 +334,8 @@
     {
     AssertNotLocked();
 
-    CMdETextPropertyCondition* condition 
-        = CMdETextPropertyCondition::NewLC(aPropertyDef, aCompareMethod, aText);
+    CMdETextPropertyCondition* condition = CMdETextPropertyCondition::NewLC( aPropertyDef, 
+                                                                                                                      aCompareMethod, aText );
     AddL(condition);
     CleanupStack::Pop(condition);
     return *condition;