Revision: 5328 http://geany.svn.sourceforge.net/geany/?rev=5328&view=rev Author: ntrel Date: 2010-10-26 15:33:16 +0000 (Tue, 26 Oct 2010)
Log Message: ----------- Sort filetypes_by_title last instead of on insertion to prevent exponential time.
Modified Paths: -------------- trunk/ChangeLog trunk/src/filetypes.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-10-26 15:20:53 UTC (rev 5327) +++ trunk/ChangeLog 2010-10-26 15:33:16 UTC (rev 5328) @@ -6,6 +6,9 @@ Add docs for 'Ensure consistent line endings' pref. * src/keyfile.c: Change default for 'Override Geany keybindings' to on. + * src/filetypes.c: + Sort filetypes_by_title last instead of on insertion to prevent + exponential time.
2010-10-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2010-10-26 15:20:53 UTC (rev 5327) +++ trunk/src/filetypes.c 2010-10-26 15:33:16 UTC (rev 5328) @@ -479,7 +479,8 @@ g_ptr_array_add(filetypes_array, ft); g_hash_table_insert(filetypes_hash, ft->name, ft);
- filetypes_by_title = g_slist_insert_sorted(filetypes_by_title, ft, cmp_filetype); + /* list will be sorted later */ + filetypes_by_title = g_slist_prepend(filetypes_by_title, ft); }
@@ -556,6 +557,9 @@ } init_custom_filetypes(app->datadir); init_custom_filetypes(utils_build_path(app->configdir, GEANY_FILEDEFS_SUBDIR, NULL)); + + /* sort last instead of on insertion to prevent exponential time */ + filetypes_by_title = g_slist_sort(filetypes_by_title, cmp_filetype); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.