Re: [PATCH 1/7] object.c: refactor type_from_string_gently()

From
Taylor Blau <hidden>
Date
2021-03-08 20:53:06
Reply to
Ævar Arnfjörð Bjarmason, 2021-03-08
On Mon, Mar 08, 2021 at 09:04:20PM +0100, Ævar Arnfjörð Bjarmason wrote:
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.
Makes sense. I don't think it hurts to mention that fe8e3b71805 also
wrote the implementation of type_from_string() as:

  #define type_from_string(str) type_from_string_gently(str, -1, 0)

making it the only caller to pass '0' for the 'gentle' parameter. So by
implementing it as a function in terms of type_from_string_gently()
which checks for a negative return value, we can drop the 'gentle'
parameter entirely.

Makes sense.

Thanks,
Taylor
Thread (103 messages) 103 messages, 6 authors, last reply 2021-04-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help