On Monday 05 May 2008 14:01, [EMAIL PROTECTED] 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...
>
> 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
> [EMAIL PROTECTED]
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>
>
pgppYVnHCTqEX.pgp
Description: PGP signature
_______________________________________________ Devl mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
