Thread (1 message) 1 message, 1 author, 2024-07-15

Re: [PATCH v2 3/1] t-strvec: tighten .alloc check in check_strvec

From: Junio C Hamano <hidden>
Date: 2024-07-15 17:27:22

René Scharfe [off-list ref] writes:
quoted
quoted
 		    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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help