Re: svn commit: r1305050 - in /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning: DefaultSpanningTreeSourceSelector.java ReverseDeleteGraph.java

2012-03-25 Thread Simone Tripodi
Great, I like it!

just a minor observation:

 +        for ( int i = 0; i  sortedEdge.size(); i++ )
         {
 -            WE we = iterator.next();
 -            iterator.remove();
 +            WE we = sortedEdge.poll();


do we really need to cycle guarding an accumulator? I'd replace it with:

while ( !sortedEdge.isEmpty() )
{
WE we = sortedEdge.poll();
}

best,
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: svn commit: r1305050 - in /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning: DefaultSpanningTreeSourceSelector.java ReverseDeleteGraph.java

2012-03-25 Thread Simone Tripodi
I just modified it, see r1305065

best,
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Sun, Mar 25, 2012 at 4:46 PM, Simone Tripodi
simonetrip...@apache.org wrote:
 Great, I like it!

 just a minor observation:

 +        for ( int i = 0; i  sortedEdge.size(); i++ )
         {
 -            WE we = iterator.next();
 -            iterator.remove();
 +            WE we = sortedEdge.poll();


 do we really need to cycle guarding an accumulator? I'd replace it with:

 while ( !sortedEdge.isEmpty() )
 {
    WE we = sortedEdge.poll();
 }

 best,
 -Simo

 http://people.apache.org/~simonetripodi/
 http://simonetripodi.livejournal.com/
 http://twitter.com/simonetripodi
 http://www.99soft.org/

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org