commit | 131352433621e89b2e8c58d8327b1d55bf0bc8d0 | [log] [tgz] |
---|---|---|
author | Michael Haggerty <mhagger@alum.mit.edu> | Sun Nov 04 08:07:08 2012 +0100 |
committer | Jeff King <peff@peff.net> | Thu Nov 08 11:34:36 2012 -0500 |
tree | 9e1b10b0054233197d648d5af5dbcd531bef01ea | |
parent | f992f0c80f30ac5a0aacfdfad55083dafb33047e [diff] |
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>