Changeset 3a57140d761afe12d2d4ee04218ccae446478302

Show
Ignore:
Timestamp:
24/07/08 00:04:20 (4 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1216850660 +0200
git-parent:

[ad868bfefb79f351e578890f740fb6133573d901]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1216837386 +0200
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/misc/variables.c

    r3e3d877 r3a57140  
    474474            break; 
    475475        case VLC_VAR_ADDCHOICE: 
    476             /* FIXME: the list is sorted, dude. Use something cleverer. */ 
    477             for( i = p_var->choices.i_count ; i-- ; ) 
    478             { 
    479                 if( p_var->pf_cmp( p_var->choices.p_values[i], *p_val ) < 0 ) 
    480                 { 
    481                     break; 
    482                 } 
    483             } 
    484  
    485             /* The new place is i+1 */ 
    486             i++; 
    487  
    488             if( p_var->i_default >= i ) 
    489             { 
    490                 p_var->i_default++; 
    491             } 
     476            i = p_var->choices.i_count; 
    492477 
    493478            INSERT_ELEM( p_var->choices.p_values, p_var->choices.i_count, 
     
    503488            break; 
    504489        case VLC_VAR_DELCHOICE: 
    505             /* FIXME: the list is sorted, dude. Use something cleverer. */ 
    506490            for( i = 0 ; i < p_var->choices.i_count ; i++ ) 
    507491            {