Mercurial > audlegacy
changeset 1946:12bf555c8e47 trunk
[svn] - require at least 3 bytes of data to search
author | nenolod |
---|---|
date | Sun, 05 Nov 2006 13:59:09 -0800 |
parents | 89e1e4b392b4 |
children | eec23019ef57 |
files | ChangeLog audacious/mainwin.c |
diffstat | 2 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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 <nenolod@nenolod.net> + 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 <nenolod@nenolod.net> revision [2845] - improve algorithm further
--- 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);