Commit fa6ca11
merge-recursive.c: use string_list_sort instead of qsort
Merge-recursive sorts a string list using a raw qsort(), where it
feeds the "items" from one struct but the "nr" and size fields from
another struct. This isn't a bug because one list is a copy of the
other, but it's unnecessarily confusing (and also caused our recent
QSORT() cleanups via coccinelle to miss this call site).
Let's use string_list_sort() instead, which is more concise and harder
to get wrong. Note that we need to adjust our comparison function,
which gets fed only the strings now, not the string_list_items. That's
OK because we don't use the "util" field as part of our sort.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent ac84098 commit fa6ca11
1 file changed
+7
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
| 393 | + | |
| 394 | + | |
397 | 395 | | |
398 | 396 | | |
399 | 397 | | |
| |||
406 | 404 | | |
407 | 405 | | |
408 | 406 | | |
409 | | - | |
410 | | - | |
| 407 | + | |
| 408 | + | |
411 | 409 | | |
412 | 410 | | |
413 | 411 | | |
| |||
451 | 449 | | |
452 | 450 | | |
453 | 451 | | |
454 | | - | |
455 | | - | |
| 452 | + | |
| 453 | + | |
456 | 454 | | |
457 | 455 | | |
458 | 456 | | |
| |||
0 commit comments