commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1137179 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java
Date Sat, 18 Jun 2011 12:42:20 GMT
Author: simonetripodi
Date: Sat Jun 18 12:42:19 2011
New Revision: 1137179

URL: http://svn.apache.org/viewvc?rev=1137179&view=rev
Log:
fixed Queue management policy

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java?rev=1137179&r1=1137178&r2=1137179&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java Sat
Jun 18 12:42:19 2011
@@ -23,6 +23,7 @@ import static org.apache.commons.graph.u
 
 import java.util.HashSet;
 import java.util.LinkedList;
+import java.util.Queue;
 import java.util.Set;
 import java.util.Stack;
 
@@ -79,7 +80,7 @@ public final class Visit
             handler.discoverGraph( graph );
         }
 
-        LinkedList<V> vertexQueue = new LinkedList<V>();
+        Queue<V> vertexQueue = new LinkedList<V>();
         vertexQueue.add( source );
 
         Set<V> visitedVetices = new HashSet<V>();
@@ -107,7 +108,7 @@ public final class Visit
                         handler.discoverEdge( e );
                     }
 
-                    vertexQueue.addFirst( w );
+                    vertexQueue.offer( w );
 
                     if ( handler != null )
                     {



Mime
View raw message