Re: [PATCH 08/29] ref_transaction_commit(): remove local variable n
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 27, 2016, 18:16 UTC
- Message-ID
- <xmqqeg9qape3.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <9c31a016aa893e4a3748e31ee3fd48562f63a7a7.1461768689.git.mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 9 quoted lines
> This microoptimization doesn't make a significant difference in speed. > And it causes problems if somebody ever wants to modify the function to > add updates to a transaction as part of processing it, as will happen > shortly. > > Make the same change in initial_ref_transaction_commit(). > > Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> > ---
This particular change also makes the end result easier to read. I have no objection to officially declaring that we do support "adding" new transaction update while we are committing (and we do not support other futzing like "removing" or "reordering"), either.
I expect that somewhere in this series transaction->nr will not stay constant even if the client code of ref-transaction API makes no direct call that adds a new update[] element, though, even if it is not done in this patch.
Thanks.