Small optimisation

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14344 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Peter D'Hoye 2007-08-14 21:02:44 +00:00
parent d746b94c57
commit 360d951271

View file

@ -156,32 +156,30 @@ static char * tree_get_filename(int selected_item, void * data, char *buffer)
attr = e->attr;
}
switch(global_settings.show_filename_ext)
if(!(attr & ATTR_DIRECTORY))
{
case 0:
/* show file extension: off */
stripit = true;
break;
case 1:
/* show file extension: on */
stripit = false;
break;
case 2:
/* show file extension: only unknown types */
stripit = filetype_supported(attr);
break;
case 3:
default:
/* show file extension: only when viewing all */
stripit = (*(local_tc->dirfilter) != SHOW_ID3DB) &&
(*(local_tc->dirfilter) != SHOW_ALL);
break;
switch(global_settings.show_filename_ext)
{
case 0:
/* show file extension: off */
stripit = true;
break;
case 1:
/* show file extension: on */
break;
case 2:
/* show file extension: only unknown types */
stripit = filetype_supported(attr);
break;
case 3:
default:
/* show file extension: only when viewing all */
stripit = (*(local_tc->dirfilter) != SHOW_ID3DB) &&
(*(local_tc->dirfilter) != SHOW_ALL);
break;
}
}
/* global overrule: don't strip if it's a dir */
if(attr & ATTR_DIRECTORY)
stripit = false;
if(stripit)
{
return(strip_extension(name, buffer));