From 3a57140d761afe12d2d4ee04218ccae446478302 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Wed, 23 Jul 2008 20:23:06 +0200 Subject: [PATCH] variables: Don't sort the choice list here. Because, the algo is bad and because we can't set the order of the list ourselves then. --- src/misc/variables.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/misc/variables.c b/src/misc/variables.c index 45d15cfe5e..ed5f31a03d 100644 --- a/src/misc/variables.c +++ b/src/misc/variables.c @@ -473,22 +473,7 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name, } break; case VLC_VAR_ADDCHOICE: - /* FIXME: the list is sorted, dude. Use something cleverer. */ - for( i = p_var->choices.i_count ; i-- ; ) - { - if( p_var->pf_cmp( p_var->choices.p_values[i], *p_val ) < 0 ) - { - break; - } - } - - /* The new place is i+1 */ - i++; - - if( p_var->i_default >= i ) - { - p_var->i_default++; - } + i = p_var->choices.i_count; INSERT_ELEM( p_var->choices.p_values, p_var->choices.i_count, i, *p_val ); @@ -502,7 +487,6 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name, CheckValue( p_var, &p_var->val ); break; case VLC_VAR_DELCHOICE: - /* FIXME: the list is sorted, dude. Use something cleverer. */ for( i = 0 ; i < p_var->choices.i_count ; i++ ) { if( p_var->pf_cmp( p_var->choices.p_values[i], *p_val ) == 0 ) -- 2.39.2