You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Simone Tripodi <si...@apache.org> on 2012/03/25 16:46:01 UTC

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

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-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


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

Posted by Simone Tripodi <si...@apache.org>.
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
<si...@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-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org