Re: [PATCH v2] csum-file: make hashwrite() more readable
- From
Jeff King <peff@peff.net>
- Date
- Mar 28, 2021, 08:38 UTC
- Message-ID
- <YGBAm9qNdn4elbKF@coredump.intra.peff.net>
- In-Reply-To
- <pull.914.v2.git.1616762291574.gitgitgadget@gmail.com>
On Fri, Mar 26, 2021 at 12:38:11PM +0000, Derrick Stolee via GitGitGadget wrote:
Show 7 quoted lines
> However, during this investigation, I inspected hashwrite() and > misunderstood it, even after looking closely and trying to make it > faster. This change simply reorganizes some parts of the loop within > hashwrite() to make it clear that each batch either uses memcpy() to the > hashfile's buffer or writes directly from the input buffer. The previous > code relied on indirection through local variables and essentially > inlined the implementation of hashflush() to reduce lines of code.
Thanks, I think this nicely argues for the change here (and I agree the result, especially with the comments, is much easier to understand).
-Peff