felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r915722 - /felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
Date Wed, 24 Feb 2010 08:42:20 GMT
Author: gnodet
Date: Wed Feb 24 08:42:20 2010
New Revision: 915722

URL: http://svn.apache.org/viewvc?rev=915722&view=rev
Log:
FELIX-2106, FELIX-692: remove unneeded outer loop in ResolverImpl#searchResources()

Modified:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java?rev=915722&r1=915721&r2=915722&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
Wed Feb 24 08:42:20 2010
@@ -368,23 +368,20 @@
     {
         List matchingCapabilities = new ArrayList();
 
-        for (int repoIdx = 0; (m_repositories != null) && (repoIdx < m_repositories.length);
repoIdx++)
+        for (int resIdx = 0; (resources != null) && (resIdx < resources.length);
resIdx++)
         {
-            for (int resIdx = 0; (resources != null) && (resIdx < resources.length);
resIdx++)
+            checkInterrupt();
+            // We don't need to look at resources we've already looked at.
+            if (!m_failedSet.contains(resources[resIdx])
+                && !m_resolveSet.contains(resources[resIdx]))
             {
-                checkInterrupt();
-                // We don't need to look at resources we've already looked at.
-                if (!m_failedSet.contains(resources[resIdx])
-                    && !m_resolveSet.contains(resources[resIdx]))
+                Capability[] caps = resources[resIdx].getCapabilities();
+                for (int capIdx = 0; (caps != null) && (capIdx < caps.length);
capIdx++)
                 {
-                    Capability[] caps = resources[resIdx].getCapabilities();
-                    for (int capIdx = 0; (caps != null) && (capIdx < caps.length);
capIdx++)
+                    if (caps[capIdx].getName().equals(req.getName())
+                            && req.isSatisfied(caps[capIdx]))
                     {
-                        if (caps[capIdx].getName().equals(req.getName())
-                                && req.isSatisfied(caps[capIdx]))
-                        {
-                            matchingCapabilities.add(caps[capIdx]);
-                        }
+                        matchingCapabilities.add(caps[capIdx]);
                     }
                 }
             }



Mime
View raw message