combine_notes_cat_sort_uniq(): sort and dedup lines all at once
commit131352433621e89b2e8c58d8327b1d55bf0bc8d0
authorMichael Haggerty <mhagger@alum.mit.edu>
Sun, 4 Nov 2012 07:07:08 +0000 (4 08:07 +0100)
committerJeff King <peff@peff.net>
Thu, 8 Nov 2012 16:34:36 +0000 (8 11:34 -0500)
tree9e1b10b0054233197d648d5af5dbcd531bef01ea
parentf992f0c80f30ac5a0aacfdfad55083dafb33047e
combine_notes_cat_sort_uniq(): sort and dedup lines all at once

Instead of reading lines one by one and insertion-sorting them into a
string_list, read all of the lines, sort them, then remove duplicates.
Aside from being less code, this reduces the complexity from O(N^2) to
O(N lg N) in the total number of lines.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Jeff King <peff@peff.net>
notes.c