Should avoid expensive 'djb2' operation now per-frame

This commit is contained in:
twinaphex 2016-05-18 21:45:06 +02:00
parent 4697d10e8c
commit c93b78147b

View File

@ -1298,6 +1298,42 @@ static void menu_action_setting_disp_set_label_system_information(
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_debug_information(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*s = '\0';
*w = 2;
menu_setting_get_label(list, s,
len, w, type, label, entry_label, i);
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label_achievement_information(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*s = '\0';
*w = 2;
menu_setting_get_label(list, s,
len, w, type, label, entry_label, i);
strlcpy(s2, path, len2);
}
static void menu_action_setting_disp_set_label(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
@ -1306,22 +1342,8 @@ static void menu_action_setting_disp_set_label(file_list_t* list,
const char *path,
char *s2, size_t len2)
{
uint32_t hash_label = menu_hash_calculate(label);
*s = '\0';
switch (hash_label)
{
case MENU_LABEL_DEBUG_INFORMATION:
*w = 2;
break;
case MENU_LABEL_ACHIEVEMENT_LIST:
*w = 2;
break;
default:
*w = 19;
break;
}
*w = 19;
menu_setting_get_label(list, s,
len, w, type, label, entry_label, i);
@ -1600,6 +1622,14 @@ int menu_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_system_information);
return 0;
case MENU_LABEL_DEBUG_INFORMATION:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_debug_information);
return 0;
case MENU_LABEL_ACHIEVEMENT_LIST:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_achievement_information);
return 0;
default:
break;
}