summaryrefslogtreecommitdiffstats
path: root/src/askloc.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-09-23 20:38:31 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-09-23 20:38:31 +0200
commit351670b5729a0f421338c4fee62faed6e8e20c63 (patch)
tree290b455201f05930ab8a03d695c12827a69a5794 /src/askloc.c
parentfa3e5583346ff55b9253c9d59b9c69798dff2226 (diff)
Speedup file sorting in NTFS undelete and local file listing by using merge sort instead of insertion sort
Diffstat (limited to 'src/askloc.c')
-rw-r--r--src/askloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/askloc.c b/src/askloc.c
index fd90106..9380cb5 100644
--- a/src/askloc.c
+++ b/src/askloc.c
@@ -54,6 +54,7 @@
#include "intrf.h"
#include "intrfn.h"
#include "list.h"
+#include "list_sort.h"
#include "dir.h"
#include "askloc.h"
#include "log.h"
@@ -248,13 +249,14 @@ char *ask_location(const char*msg, const char *src_dir, const char *dst_org)
}
#endif
file_info->name=strdup(dir_entrie->d_name);
- td_list_add_sorted(&file_info->list, &dir_list.list, filesort);
+ td_list_add_tail(&file_info->list, &dir_list.list);
file_info=(file_info_t*)MALLOC(sizeof(*file_info));
}
}
}
free(file_info);
closedir(dir);
+ td_list_sort(&dir_list.list, filesort);
}
if(dir_list.list.next!=&dir_list.list)
{