# HG changeset patch # User nenolod # Date 1162763949 28800 # Node ID 12bf555c8e474a1d4989853ff488b76c02349523 # Parent 89e1e4b392b4d4ad9d159af601ff921d980e51c4 [svn] - require at least 3 bytes of data to search diff -r 89e1e4b392b4 -r 12bf555c8e47 ChangeLog --- a/ChangeLog Sun Nov 05 13:55:21 2006 -0800 +++ b/ChangeLog Sun Nov 05 13:59:09 2006 -0800 @@ -1,3 +1,11 @@ +2006-11-05 21:55:21 +0000 William Pitcock + revision [2847] + - optimize for single-character searches (dramatic JTF speedboost) + + trunk/audacious/mainwin.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + + 2006-11-05 21:49:20 +0000 William Pitcock revision [2845] - improve algorithm further diff -r 89e1e4b392b4 -r 12bf555c8e47 audacious/mainwin.c --- a/audacious/mainwin.c Sun Nov 05 13:55:21 2006 -0800 +++ b/audacious/mainwin.c Sun Nov 05 13:59:09 2006 -0800 @@ -1950,12 +1950,10 @@ * In any case the string to match should _never_ contain * something the user can't actually see in the playlist. */ - if ((words[0] == NULL || words[0][0] == '\0') || - (words[0] != NULL && words[0][0] != '\0' && words[0][1] == '\0' && - strchr(title, words[0][0]))) + if (words[0] != NULL && strlen(words[0]) > 3) + match = mainwin_jump_to_file_match(title, words); + else match = TRUE; - else if (strlen(words[0]) > 1) - match = mainwin_jump_to_file_match(title, words); if (match) { gchar *song_index_str = g_strdup_printf("%d", song_index + 1);