On Tuesday 17 March 2009 00:13:58 Daniel Cheng wrote:
> On Mon, Mar 16, 2009 at 11:39 PM,  <[email protected]> wrote:
> > Author: saces
> > Date: 2009-03-16 15:39:05 +0000 (Mon, 16 Mar 2009)
> > New Revision: 26046
> >
> > Modified:
> >   branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
> > Log:
> > fix npe on transient put
> >
> > Modified: 
branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
> > ===================================================================
> > --- 
branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java      
2009-03-16 
14:27:05 UTC (rev 26045)
> > +++ 
branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java      
2009-03-16 
15:39:05 UTC (rev 26046)
> > @@ -338,7 +338,7 @@
> >                                container.deactivate(sfi, 1);
> >                        }
> >                        block.nullData();
> > -                       removeFrom(container, context);
> > +                       if(persistent) removeFrom(container, context);
> 
> Instead of adding  "if (persistent) " everywhere,
> why not just add it at the beginning of removeFrom() ?

Because it's cheaper not to call it in the first place.
> 
> >                } else {
> >                        SplitHandler sh = new SplitHandler();
> >                        SplitFileInserter sfi = new 
SplitFileInserter(parent, sh, data, bestCodec, origSize, 
block.clientMetadata, ctx, getCHKOnly, metadata, token, archiveType, 
shouldFreeData, persistent, container, context);

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