Re: [freenet-dev] [freenet-cvs] r19758 - trunk/freenet/src/f…

Top Page
Author: Matthew Toseland
Date:  
To: devl
Subject: Re: [freenet-dev] [freenet-cvs] r19758 - trunk/freenet/src/freenet/io/comm
Delete this message
Reply to this message
gpg: Signature made Tue May 6 00:40:52 2008 UTC using DSA key ID E43DA450
gpg: Good signature from "Matthew John Toseland <toad@amphibian.dyndns.org>"
On Monday 05 May 2008 14:01, j16sdiz@??? 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
> cvs@???
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>
>