From: Jeff King Date: Thu, 16 Apr 2026 23:24:55 GMT Subject: Re: [PATCH] MIDX: revert the default version to v1 Message-ID: <20260416232455.GB1904316@coredump.intra.peff.net> In-Reply-To: On Thu, Apr 16, 2026 at 01:55:46PM -0700, Junio C Hamano wrote: > > + ctx.version = opts->flags & MIDX_WRITE_COMPACT ? > > + MIDX_VERSION_V2 : > > + MIDX_VERSION_V1; > > Just a sytle thing but I'd prefer to see this written like this: > > + ctx.version = ((opts->flags & MIDX_WRITE_COMPACT) > + ? MIDX_VERSION_V2 > + : MIDX_VERSION_V1); > > because you do not have to worry about the precedence between & and > ?: with an extra (parentheses), and a ternary split into multiple > lines is easier to spot if you write it at the beginning of the > line, with ? and : aligned. OK. I like the "?" at the end of the first line, since it makes it clear from just that line that it is a conditional and not a direct assignment. But I don't overly care, and if you want to mark it up as you apply (if it is not already too late), I am fine with that. -Peff