convergedcallengine/cce/src/cccepluginmanager.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
--- a/convergedcallengine/cce/src/cccepluginmanager.cpp	Tue Aug 31 15:45:17 2010 +0300
+++ b/convergedcallengine/cce/src/cccepluginmanager.cpp	Wed Sep 01 12:15:03 2010 +0100
@@ -73,10 +73,10 @@
 #if 0
 // capabilities still todo here
 
-    static _LIT_SECURITY_POLICY_PASS( KAllowAllPolicy );
-    static _LIT_SECURITY_POLICY_C2( KICMPolicy, 
-                                    ECapabilityNetworkControl,
-                                    ECapabilityWriteDeviceData);    
+	static _LIT_SECURITY_POLICY_PASS( KAllowAllPolicy );
+	static _LIT_SECURITY_POLICY_C2(	KICMPolicy, 
+									ECapabilityNetworkControl,
+									ECapabilityWriteDeviceData);	
 
         
     // define first property to be integer type
@@ -471,7 +471,7 @@
     else if( iAlternativeEmergencyPlugins.Find( aUid ) == KErrNotFound )
         {
         CCELOGSTRING("CCCEPluginManager::AddToAlternativeEmergencyArray: New plugin. Append to array ");    
-        iAlternativeEmergencyPlugins.Append( aUid );  // return value ignored..
+        iAlternativeEmergencyPlugins.Append( aUid );  
         }    
     else
         {
@@ -609,16 +609,12 @@
     {
     CCCEPlugin* plugin( NULL );
     
-    // performance note: a loop is nothing but keeping count in a register, decrementing it's
-    // value after each iteration and jumping back.
-    // But, calling RPointerArray.Count() is expensive.. that's why const TInt count
-    const TInt count = iPluginArray.Count();
-    for( TInt i=0; i < count; i++ )
+    for( TInt i=0; i<iPluginArray.Count(); i++ )
         {
         if( iPluginArray[i]->Type().iUid == aImplementationUid.iUid )
             {
             plugin =  iPluginArray[i];
-            i = count;
+            i = iPluginArray.Count();
             }
         }
   
@@ -660,16 +656,14 @@
         {
         if ( iPluginArray[a]->Type() == aPluginId )
             {
-            if( KErrNone == iPluginsToClose.Append(iPluginArray[a]))
-                {          
-                if (!iIdle->IsActive())
-                    {
-                    iIdle->Start( TCallBack(RemovePlugins,this) );
-                    }
-                iPluginArray.Remove(a);
-                iPluginArray.Compress();
-                return;
+            iPluginsToClose.Append(iPluginArray[a]);
+            if (!iIdle->IsActive())
+                {
+                iIdle->Start( TCallBack(RemovePlugins,this) );
                 }
+            iPluginArray.Remove(a);
+            iPluginArray.Compress();
+            return;
             }
         }
     }
@@ -694,16 +688,14 @@
         {
         if ( iPluginArray[a]->Type() == aPluginUid )
             {
-            if( KErrNone == iPluginsToClose.Append(iPluginArray[a]))
-                {          
-                if (!iIdle->IsActive())
-                    {
-                    iIdle->Start( TCallBack(RemovePlugins,this) );
-                    }
-                iPluginArray.Remove(a);
-                iPluginArray.Compress();
-                return;
+            iPluginsToClose.Append(iPluginArray[a]);
+            if (!iIdle->IsActive())
+                {
+                iIdle->Start( TCallBack(RemovePlugins,this) );
                 }
+            iPluginArray.Remove(a);
+            iPluginArray.Compress();
+            return;
             }
         }
     }