From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
git@vger.kernel.org, "René Scharfe" <l.s.r@web.de>
Subject: Re: [PATCH] merge-recursive.c: use QSORT macro
Date: Wed, 23 Nov 2016 09:21:25 -0800 [thread overview]
Message-ID: <xmqqpolmm7sa.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20161122174946.jy5at4g7rifu3und@sigill.intra.peff.net> (Jeff King's message of "Tue, 22 Nov 2016 12:49:46 -0500")
Jeff King <peff@peff.net> writes:
> 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 ;-)
next prev parent reply other threads:[~2016-11-23 17:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-22 12:30 [PATCH] merge-recursive.c: use QSORT macro Nguyễn Thái Ngọc Duy
2016-11-22 17:49 ` Jeff King
2016-11-23 9:43 ` Duy Nguyen
2016-11-23 17:21 ` Junio C Hamano [this message]
2016-11-24 11:45 ` [PATCH v2] merge-recursive.c: use string_list_sort instead of qsort Nguyễn Thái Ngọc Duy
2016-11-24 20:52 ` Jeff King
2016-11-25 12:15 ` Duy Nguyen
2016-11-25 17:15 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqpolmm7sa.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.