[kaffe] Re: LinkedList.subList severely broken

Dalibor Topic robilad at yahoo.com
Wed May 21 10:34:01 PDT 2003


Salut Daniel,

--- Daniel Bonniot <Daniel.Bonniot at inria.fr> wrote:
> 
> > 	LinkedListIterator(LinkedList list, int index) {
> > 		super(list, index);
> > 		elem = list.head;
> >+		// Position elem to the index'th element.
> >+		// We know that index is a valid index, because that was 
> >+		// checked in the constructor in AbstractListIterator.
> >+		for (; index > 0; index--)
> >+		  elem = elem.next;
> >
> 
> Maybe it would be simpler and more robust (but a little bit less 
> efficient?) to just have:
> 
>  		super(list, index);
>  		elem = list.get(index);
> 
> Which one is considered better?

simpler code is always better in my opinion. Easier to write, easier to
understand, easier to change.

> Should I send a changelog entry too?

that would be nice, thanks.

cheers,
dalibor topic

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com




More information about the kaffe mailing list