diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-11-04 08:07:08 +0100 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2012-11-08 11:34:36 -0500 |
commit | 131352433621e89b2e8c58d8327b1d55bf0bc8d0 (patch) | |
tree | 9e1b10b0054233197d648d5af5dbcd531bef01ea /sha1_name.c | |
parent | Initialize sort_uniq_list using named constant (diff) | |
download | tgif-131352433621e89b2e8c58d8327b1d55bf0bc8d0.tar.xz |
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>
Diffstat (limited to 'sha1_name.c')
0 files changed, 0 insertions, 0 deletions