SF.net SVN: geany:[4574] branches/geany-0.18.1
ntrel at users.sourceforge.net
ntrel at xxxxx
Thu Jan 28 16:04:33 UTC 2010
Revision: 4574
http://geany.svn.sourceforge.net/geany/?rev=4574&view=rev
Author: ntrel
Date: 2010-01-28 16:04:30 +0000 (Thu, 28 Jan 2010)
Log Message:
-----------
Backport:
Speed up sorting in utils_get_file_list(). This reduces the file
browser delay on displaying a big directory, e.g. /usr/bin.
Modified Paths:
--------------
branches/geany-0.18.1/ChangeLog
branches/geany-0.18.1/src/utils.c
Modified: branches/geany-0.18.1/ChangeLog
===================================================================
--- branches/geany-0.18.1/ChangeLog 2010-01-28 13:35:54 UTC (rev 4573)
+++ branches/geany-0.18.1/ChangeLog 2010-01-28 16:04:30 UTC (rev 4574)
@@ -1,3 +1,10 @@
+2009-09-21 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/utils.c:
+ Speed up sorting in utils_get_file_list(). This reduces the file
+ browser delay on displaying a big directory, e.g. /usr/bin.
+
+
2009-09-15 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/search.c:
Modified: branches/geany-0.18.1/src/utils.c
===================================================================
--- branches/geany-0.18.1/src/utils.c 2010-01-28 13:35:54 UTC (rev 4573)
+++ branches/geany-0.18.1/src/utils.c 2010-01-28 16:04:30 UTC (rev 4574)
@@ -1376,10 +1376,12 @@
if (filename == NULL)
break;
- list = g_slist_insert_sorted(list, g_strdup(filename), (GCompareFunc) utils_str_casecmp);
+ list = g_slist_append(list, g_strdup(filename));
len++;
}
g_dir_close(dir);
+ /* sorting last is quicker than on insertion */
+ list = g_slist_sort(list, (GCompareFunc) utils_str_casecmp);
if (length)
*length = len;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list