On Tuesday 06 May 2008 01:40, Matthew Toseland wrote: > On Monday 05 May 2008 14:01, j16sdiz at freenetproject.org wrote: > > Author: j16sdiz > > Date: 2008-05-05 13:01:35 +0000 (Mon, 05 May 2008) > > New Revision: 19758 > > > > Modified: > > trunk/freenet/src/freenet/io/comm/MessageFilter.java > > Log: > > use LinkedList instead of Vector(1,1) > > Why? LinkedList will use more memory!! These are moderately long lived > objects, because we keep unmatched messages for an hour...
Doh, these are filters, not messages. Nonetheless, I don't see why we should use a list here...? > > > > Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java > > =================================================================== > > --- trunk/freenet/src/freenet/io/comm/MessageFilter.java 2008-05-05 12:12:06 > UTC (rev 19757) > > +++ trunk/freenet/src/freenet/io/comm/MessageFilter.java 2008-05-05 13:01:35 > UTC (rev 19758) > > @@ -37,7 +37,7 @@ > > private PeerContext _droppedConnection; > > private MessageType _type; > > private HashMap _fields = new HashMap(); > > - private Vector _fieldList = new Vector(1,1); > > + private List _fieldList = new LinkedList(); > > private PeerContext _source; > > private long _timeout; > > /** If true, timeouts are relative to the start of waiting, if false, > they are relative to > > @@ -177,8 +177,9 @@ > > return false; > > } > > synchronized (_fields) { > > - for (int i = 0; i < _fieldList.size(); i++) { > > - String fieldName = (String) _fieldList.get(i); > > + ListIterator it = _fieldList.listIterator(); > > + while (it.hasNext()) { > > + String fieldName = (String) it.next(); > > if (!m.isSet(fieldName)) { > > return false; > > } > > > > _______________________________________________ > > cvs mailing list > > cvs at freenetproject.org > > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20080506/71aafa20/attachment.pgp>