On Tuesday 28 April 2009 21:10:37 Matthew Toseland wrote:
> On Thursday 16 April 2009 23:42:32 [email protected] wrote:
> > Author: nextgens
> > Date: 2009-04-16 22:42:32 +0000 (Thu, 16 Apr 2009)
> > New Revision: 26911
> > 
> > Modified:
> >    branches/nextgens-stuffs/freenet/src/freenet/io/comm/Message.java
> >    branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageFilter.java
> > Log:
> > Cheap optimization
> > 
> > Modified: 
branches/nextgens-stuffs/freenet/src/freenet/io/comm/Message.java
> > ===================================================================
> > --- branches/nextgens-stuffs/freenet/src/freenet/io/comm/Message.java       
> 2009-04-16 22:38:46 UTC (rev 26910)
> > +++ branches/nextgens-stuffs/freenet/src/freenet/io/comm/Message.java       
> 2009-04-16 22:42:32 UTC (rev 26911)
> > @@ -285,6 +285,10 @@
> >     public MessageType getSpec() {
> >             return _spec;
> >     }
> > +   
> > +   public int fieldCount() {
> > +           return _payload.size();
> > +   }
> >  
> >     public boolean isSet(String fieldName) {
> >             return _payload.containsKey(fieldName);
> > 
> > Modified: 
> branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageFilter.java
> > ===================================================================
> > --- 
branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageFilter.java 
> 2009-04-16 22:38:46 UTC (rev 26910)
> > +++ 
branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageFilter.java 
> 2009-04-16 22:42:32 UTC (rev 26911)
> > @@ -186,6 +186,9 @@
> >                     return false;
> >             }
> >             synchronized (_fields) {
> > +                   if(_fieldList.size() > m.fieldCount())
> > +                           return false;
> 
> Looks bogus to me.

Doh, in fact this is a sensible optimisation.
> > +                   
> >                     for (String fieldName : _fieldList) {
> >                             if (!m.isSet(fieldName)) {
> >                                     return false;
> 


Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to