On Tuesday 17 March 2009 00:13:58 Daniel Cheng wrote:
> On Mon, Mar 16, 2009 at 11:39 PM, <saces at freenetproject.org> 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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20090324/70666546/attachment.pgp>