commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1145605 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
Date Tue, 12 Jul 2011 14:21:12 GMT
Author: simonetripodi
Date: Tue Jul 12 14:21:12 2011
New Revision: 1145605

URL: http://svn.apache.org/viewvc?rev=1145605&view=rev
Log:
compacted min node child iteration loop

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java?rev=1145605&r1=1145604&r2=1145605&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
Tue Jul 12 14:21:12 2011
@@ -269,7 +269,7 @@ public final class FibonacciHeap<E>
 
         // for each child x of z
         FibonacciHeapNode<E> x = z.getChild();
-        for ( int degree = z.getDegree(); degree > 0; degree-- )
+        for ( int degree = z.getDegree(); degree > 0; degree--, x = x.getRight() )
         {
             // add x to the root list of H
             z.getLeft().setRight( x );
@@ -279,8 +279,6 @@ public final class FibonacciHeap<E>
 
             // p[x] <- NIL
             x.setParent( null );
-
-            x = x.getRight();
         }
 
         // remove z from the root list of H



Mime
View raw message