git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] merge-recursive.c: use QSORT macro

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 23, 2016, 17:21 UTC
Message-ID
<xmqqpolmm7sa.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20161122174946.jy5at4g7rifu3und@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> Another possibility is:
>
>   df_sorted_entries.cmp = string_list_df_name_compare;
>   string_list_sort(&df_sorted_entries);
>
> It's not any shorter, but maybe it's conceptually simpler.

My first reaction to Duy's patch was: it is moronic for the string-list API not to offer "I've done _append() to add many items while avoiding the overhead of doing insertion sort all the time; now I finished adding and I want the result sorted".

And then I looked at string-list.h and there it was ;-)
Previous: Duy NguyenNext: Nguyễn Thái Ngọc Duy
Message 4 of 8 in “merge-recursive.c: use QSORT macro”
  1. merge-recursive.c: use QSORT macroNguyễn Thái Ngọc Duy, Nov 22, 2016
  2. Jeff KingNov 22, 2016
  3. Duy NguyenNov 23, 2016
  4. Junio C HamanoNov 23, 2016
  5. merge-recursive.c: use string_list_sort instead of qsortNguyễn Thái Ngọc Duy, Nov 24, 2016
  6. Jeff KingNov 24, 2016
  7. Duy NguyenNov 25, 2016
  8. Jeff KingNov 25, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.