xdiff/xdl_cleanup_records: make setting action easier to follow

Rewrite nested ternaries with a clear if/else ladder for action1/action2 to improve readability while preserving behavior. Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ezekiel Newren committed Apr 29, 2026 at 22:08 UTC c355f69cda6d2df4972131b77dc0702d82b29d8b
1 file changed +12 -2
xdiff/xprepare.c
+12 -2
@@ -302,7 +302,12 @@ static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xd
302 size_t mph1 = xdf1->recs[i].minimal_perfect_hash;
303 rcrec = cf->rcrecs[mph1];
304 nm = rcrec ? rcrec->len2 : 0;
305 - action1[i] = (nm == 0) ? DISCARD: nm >= mlim1 ? INVESTIGATE: KEEP;
305 + if (nm == 0)
306 + action1[i] = DISCARD;
307 + else if (nm < mlim1)
308 + action1[i] = KEEP;
309 + else /* nm >= mlim1 */
310 + action1[i] = INVESTIGATE;
311 }
312
313 if (need_min) {
@@ -317,7 +322,12 @@ static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xd
322 size_t mph2 = xdf2->recs[i].minimal_perfect_hash;
323 rcrec = cf->rcrecs[mph2];
324 nm = rcrec ? rcrec->len1 : 0;
320 - action2[i] = (nm == 0) ? DISCARD: nm >= mlim2 ? INVESTIGATE: KEEP;
325 + if (nm == 0)
326 + action2[i] = DISCARD;
327 + else if (nm < mlim2)
328 + action2[i] = KEEP;
329 + else /* nm >= mlim2 */
330 + action2[i] = INVESTIGATE;
331 }
332
333 /*