# HG changeset patch # User nenolod # Date 1162763721 28800 # Node ID 89e1e4b392b4d4ad9d159af601ff921d980e51c4 # Parent e3cd747562d65fb198d0b69106bb377237d92a8a [svn] - optimize for single-character searches (dramatic JTF speedboost) diff -r e3cd747562d6 -r 89e1e4b392b4 ChangeLog --- a/ChangeLog Sun Nov 05 13:49:20 2006 -0800 +++ b/ChangeLog Sun Nov 05 13:55:21 2006 -0800 @@ -1,3 +1,11 @@ +2006-11-05 21:49:20 +0000 William Pitcock + revision [2845] + - improve algorithm further + + trunk/audacious/mainwin.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + + 2006-11-05 21:33:25 +0000 William Pitcock revision [2843] - use g_strcasecmp instead of several g_strdowns to speed up jump-to-file performance. closes #56 diff -r e3cd747562d6 -r 89e1e4b392b4 audacious/mainwin.c --- a/audacious/mainwin.c Sun Nov 05 13:49:20 2006 -0800 +++ b/audacious/mainwin.c Sun Nov 05 13:55:21 2006 -0800 @@ -1950,10 +1950,12 @@ * In any case the string to match should _never_ contain * something the user can't actually see in the playlist. */ - if (words[0]) + if ((words[0] == NULL || words[0][0] == '\0') || + (words[0] != NULL && words[0][0] != '\0' && words[0][1] == '\0' && + strchr(title, words[0][0]))) + match = TRUE; + else if (strlen(words[0]) > 1) match = mainwin_jump_to_file_match(title, words); - else - match = TRUE; if (match) { gchar *song_index_str = g_strdup_printf("%d", song_index + 1);