Don't recalculate the array length during the loop, use the ARRAYLEN macro and correct the type of the variable i.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22130 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-08-03 01:42:08 +00:00
parent 85ece84b1c
commit 16a6453842
1 changed files with 3 additions and 2 deletions

View File

@ -436,8 +436,9 @@ static int item_callback(int action, const struct menu_item_ex *this_item)
}
static int get_selection(int last_screen)
{
unsigned int i;
for(i=0; i< sizeof(root_menu__)/sizeof(*root_menu__); i++)
int i;
int len = ARRAYLEN(root_menu__);
for(i=0; i < len; i++)
{
if (((root_menu__[i]->flags&MENU_TYPE_MASK) == MT_RETURN_VALUE) &&
(root_menu__[i]->value == last_screen))