comparison gui/dialog/fileselect.c @ 35851:3ad8e723bb09

Simplify array index handling. Calculate index by a simple decrementation.
author ib
date Sun, 10 Mar 2013 14:27:22 +0000
parents 95ff5695a70b
children 1eb092275eb8
comparison
equal deleted inserted replaced
35850:95ff5695a70b 35851:3ad8e723bb09
396 entry=fsHistory[i]; 396 entry=fsHistory[i];
397 break; 397 break;
398 } 398 }
399 if ( i == FF_ARRAY_ELEMS(fsHistory) ) 399 if ( i == FF_ARRAY_ELEMS(fsHistory) )
400 { 400 {
401 i=FF_ARRAY_ELEMS(fsHistory)-1; 401 nfree( fsHistory[--i] );
402 nfree( fsHistory[i] );
403 entry=strdup( subject ); 402 entry=strdup( subject );
404 } 403 }
405 for ( ;i;i-- ) fsHistory[i]=fsHistory[i - 1]; 404 for ( ;i;i-- ) fsHistory[i]=fsHistory[i - 1];
406 fsHistory[0]=entry; 405 fsHistory[0]=entry;
407 } 406 }