Re: [PATCH 2/4] string-list: replace negative index encoding with "exact_match" parameter
- From
shejialuo <shejialuo@gmail.com>
- Date
- Sep 15, 2025, 12:11 UTC
- Message-ID
- <aMgCdDLjOTlWi1GH@ArchLinux>
- In-Reply-To
- <aL_HwMEJBLjrV8WP@pks.im>
On Tue, Sep 09, 2025 at 08:22:56AM +0200, Patrick Steinhardt wrote:
Show 15 quoted lines
> > index 2b438c7733..03c7009472 100644 > > --- a/string-list.h > > +++ b/string-list.h > > @@ -174,7 +174,7 @@ void string_list_remove_empty_items(struct string_list *list, int free_util); > > /** Determine if the string_list has a given string or not. */ > > int string_list_has_string(const struct string_list *list, const char *string); > > int string_list_find_insert_index(const struct string_list *list, const char *string, > > - int negative_existing_index); > > + int *exact_match); > > > > Makes me wonder whether we want to use `bool *exact_match` now to hint > that this is really only a true/false value? If so, we'd also have to > adapt the signature in the preceding commit. >
That's right, I think `bool *` would be much better. I would improve this in the next version.
Thanks, Jialuo