Re: [PATCH 1/7] object.c: refactor type_from_string_gently()
- From
Jeff King <peff@peff.net>
- Date
- Mar 9, 2021, 10:46 UTC
- Message-ID
- <YEdR7oAcu13F8/d5@coredump.intra.peff.net>
- In-Reply-To
- <20210308200426.21824-2-avarab@gmail.com>
On Mon, Mar 08, 2021 at 09:04:20PM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 11 quoted lines
> Get rid of the "gently" argument to type_from_string_gently() to make > it consistent with most other *_gently() functions. > > This refactoring of adding a third parameter was done in > fe8e3b71805 (Refactor type_from_string() to allow continuing after > detecting an error, 2014-09-10) in preparation for its use in > fsck.c. > > Since then no callers of this function have passed a "len < 0" as was > expected might happen, so we can simplify its invocation by knowing > that it's never called like that.
This final paragraph confused me. What does "len < 0" have to do with "gently"?
I think the answer is just that the non-gentle form never bothered to take a "len" parameter, so you are doing both simplifications at once. IMHO it would be easier to understand broken into two commits (but not necessarily worth re-rolling).
-Peff