On Monday 06 April 2009 07:52:21 Daniel Cheng wrote: > On Mon, Apr 6, 2009 at 2:51 PM, <[email protected]> wrote: > > Author: xor > > Date: 2009-04-06 06:51:12 +0000 (Mon, 06 Apr 2009) > > New Revision: 26557 > > > > Modified: > > trunk/freenet/src/freenet/support/DoublyLinkedList.java > > Log: > > Add more comments to the FIXME. > > > > Modified: trunk/freenet/src/freenet/support/DoublyLinkedList.java > > =================================================================== > > --- trunk/freenet/src/freenet/support/DoublyLinkedList.java 2009-04-06 06:49:39 UTC (rev 26556) > > +++ trunk/freenet/src/freenet/support/DoublyLinkedList.java 2009-04-06 06:51:12 UTC (rev 26557) > > @@ -18,6 +18,16 @@ > > Keep it out from the new code if you can. > > > > IF you REALLY HAVE to use it, PLEASE add a junit test for all new method you created." > > + > > +---------- > > +toad replied: > > +> The purpose of DoublyLinkedList is simply and solely so that > > +> we can override the entries with our own classes. This makes > > +> removal for example extremely > > +> fast: O(1) not O(n). In any other case we can use LinkedList. > > +----------- > > + > > +so should we keep this class and use it everywhere or not? > > */ > > The rule is: If you have to ask, don't use it.
Exactly. Use it where you need O(1) removal or need direct access to the elements for some other reason, but not elsewhere.
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Devl mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
