Re: [PATCH v4 1/3] branch: avoid unnecessary worktrees traversals
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Feb 27, 2023, 19:30 UTC
- Message-ID
- <20230227193012.2410973-1-jonathantanmy@google.com>
- In-Reply-To
- <4e6aeffe-98ef-b4d7-7c8f-782e0a617653@gmail.com>
Rubén Justo <rjusto@gmail.com> writes:
Show 5 quoted lines
> Reviewing this, I noticed I made a mistake here. The original code > doesn't stop iterating whenever refs_create_symref() fails; it continues > trying to update the remaining worktrees. When the iteration ends, if > any of the updates failed, then die(). Also, the error message "HEAD of > working tree %s is not updated" is lost.
Ah yes, I noticed this too.
Besides that, a reviewer, upon reading the commit message, might ask: why not take the worktrees as a parameter then, if we're so worried about performance? I think that the real reason for inlining is that the code being inlined needs to communicate more information to its calling function in subsequent patches; the performance improvement is only a beneficial side effect.