Start using menu_setting_find_prehashed

This commit is contained in:
twinaphex 2016-03-21 20:56:11 +01:00
parent 552959933d
commit 7cc6c477b8
3 changed files with 25 additions and 3 deletions

View File

@ -360,7 +360,17 @@ static int general_push(menu_displaylist_info_t *info,
switch (id)
{
case PUSH_ARCHIVE_OPEN_DETECT_CORE:
info->setting = menu_setting_find(info->label);
case PUSH_ARCHIVE_OPEN:
case PUSH_DEFAULT:
info->setting = menu_setting_find_prehashed(info->label, info->label_hash);
break;
default:
break;
}
switch (id)
{
case PUSH_ARCHIVE_OPEN_DETECT_CORE:
if (!string_is_empty(list->all_ext))
strlcpy(info->exts, list->all_ext, sizeof(info->exts));
@ -374,7 +384,6 @@ static int general_push(menu_displaylist_info_t *info,
strlcpy(info->exts, system->valid_extensions, sizeof(info->exts));
break;
case PUSH_ARCHIVE_OPEN:
info->setting = menu_setting_find(info->label);
if (system_menu->valid_extensions)
{
if (*system_menu->valid_extensions)
@ -385,7 +394,6 @@ static int general_push(menu_displaylist_info_t *info,
strlcpy(info->exts, system->valid_extensions, sizeof(info->exts));
break;
case PUSH_DEFAULT:
info->setting = menu_setting_find(info->label);
if (menu_setting_get_browser_selection_type(info->setting) == ST_DIR)
{
}

View File

@ -1937,6 +1937,18 @@ rarch_setting_t *menu_setting_find(const char *label)
return menu_setting_find_internal(setting, label, needle);
}
rarch_setting_t *menu_setting_find_prehashed(const char *label, uint32_t needle)
{
rarch_setting_t *setting = NULL;
menu_entries_ctl(MENU_ENTRIES_CTL_SETTINGS_GET, &setting);
if (!setting || !label)
return NULL;
return menu_setting_find_internal(setting, label, needle);
}
int menu_setting_set_flags(rarch_setting_t *setting)
{
if (!setting)

View File

@ -280,6 +280,8 @@ int menu_setting_set(unsigned type, const char *label,
**/
rarch_setting_t *menu_setting_find(const char *label);
rarch_setting_t *menu_setting_find_prehashed(const char *label, uint32_t needle);
/**
* setting_set_with_string_representation:
* @setting : pointer to setting