Re: [PATCH v2 3/1] t-strvec: tighten .alloc check in check_strvec
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 15, 2024, 17:27 UTC
- Message-ID
- <xmqq4j8q4lcb.fsf@gitster.g>
- In-Reply-To
- <bf7fd471-18fb-41df-a306-2413c9d441bd@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 11 quoted lines
>>> check_uint((vec)->nr, ==, ARRAY_SIZE(expect) - 1) && \
>>> - check_uint((vec)->nr, <=, (vec)->alloc)) { \
>>> + ((vec)->v == empty_strvec ? \
>>> + check_uint((vec)->nr, ==, (vec)->alloc) : \
>>> + check_uint((vec)->nr, <, (vec)->alloc))) { \
>>
>> Not a huge deal but with empty_strvec, don't we want to barf if
>> nr==alloc==1?
>
> Yes, and that's handled by the comparison with ARRAY_SIZE(expect) - 1
> above.Ah, OK, thanks.