Robert Collins wrote:
> I'd like to delete add_text completely, as previously mentioned - moving to
> just a single way to add content to a repo, which will permit commit to a
> stacked repo, and make it easier to be confident we've squelched all these
> copy bugs.
>
Sure, but you would retain the stack of FulltextContentFactory being
passed to another function.
And you can't pass an object to another one without a reference, and
having a reference in the outer means it won't be released in the inner.
_add_text was just a convenience/incremental improvement over add_lines().
We'd still need some way to pass a string to a function and be able to
tell it: "I don't need this anymore, you can do what you want with it."
Also, the current code never deletes 'text', which means that:
text = file.read()
Will hold 2x files in memory while the new one is read, before the old
one is removed. Doing:
text = None
text = file.read()
or some variant on that would get around it.
John
=:_>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> I'd like to delete add_text completely, as previously mentioned - moving to
> just a single way to add content to a repo, which will permit commit to a
> stacked repo, and make it easier to be confident we've squelched all these
> copy bugs.
>
Sure, but you would retain the stack of FulltextContent Factory being
passed to another function.
And you can't pass an object to another one without a reference, and incremental improvement over add_lines().
having a reference in the outer means it won't be released in the inner.
_add_text was just a convenience/
We'd still need some way to pass a string to a function and be able to
tell it: "I don't need this anymore, you can do what you want with it."
Also, the current code never deletes 'text', which means that:
text = file.read()
Will hold 2x files in memory while the new one is read, before the old
one is removed. Doing:
text = None
text = file.read()
or some variant on that would get around it.
John
=:_>
-----BEGIN PGP SIGNATURE----- enigmail. mozdev. org/
M9QIACgkQJdeBCY SNAAPMvgCglUHwF kdUGaLBR2S+ 8LN3hm9X MzOXFX1tTC9R93D ov
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkv
xdEAoIFNvdtjaZk
=vY/0
-----END PGP SIGNATURE-----