D4582: censor: use a reasonable amount of memory
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Thu Sep 13 19:01:08 EDT 2018
durin42 added a comment.
In https://phab.mercurial-scm.org/D4582#69941, @indygreg wrote:
> This effectively changes things from a list to a generator. That means we can only iterate `headctxs` once.
>
> We do only iterate `headctxs` once, so this is safe. But it isn't a good practice to leave a generator variable around in the local scope.
>
> Perhaps we could rewrite this as a normal `for` loop that iteratively builds up `heads` using `.append()`.
I'm honestly fine with this change as-stated. Would you feel better if it was called `headctxsgen` instead?
(the for-loop-and-append is probably slightly slower, but I haven't benchmarked it)
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4582
To: valentin.gatienbaron, #hg-reviewers
Cc: durin42, indygreg, mercurial-devel
More information about the Mercurial-devel
mailing list