mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Start getting rid of msg_hash_calculate in menu code
This commit is contained in:
parent
c9fd0d4a77
commit
85e7920b66
@ -485,15 +485,12 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
|
||||
unsigned i;
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
uint32_t label_setting_hash;
|
||||
char label_setting[128];
|
||||
|
||||
label_setting[0] = '\0';
|
||||
|
||||
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
|
||||
label_setting_hash = msg_hash_calculate(label_setting);
|
||||
|
||||
if (label_hash != label_setting_hash)
|
||||
if (!string_is_equal(label_setting, label))
|
||||
continue;
|
||||
|
||||
BIND_ACTION_LEFT(cbs, bind_left_generic);
|
||||
|
@ -595,15 +595,12 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
|
||||
unsigned i;
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
uint32_t label_setting_hash;
|
||||
char label_setting[128];
|
||||
|
||||
label_setting[0] = '\0';
|
||||
|
||||
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
|
||||
label_setting_hash = msg_hash_calculate(label_setting);
|
||||
|
||||
if (label_hash != label_setting_hash)
|
||||
if (!string_is_equal(label, label_setting))
|
||||
continue;
|
||||
|
||||
BIND_ACTION_RIGHT(cbs, bind_right_generic);
|
||||
|
@ -820,19 +820,14 @@ int menu_action_handle_setting(rarch_setting_t *setting,
|
||||
static rarch_setting_t *menu_setting_find_internal(rarch_setting_t *setting,
|
||||
const char *label)
|
||||
{
|
||||
uint32_t needle = msg_hash_calculate(label);
|
||||
rarch_setting_t **list = &setting;
|
||||
|
||||
for (; setting_get_type(setting) != ST_NONE; (*list = *list + 1))
|
||||
{
|
||||
if ( (needle == setting->name_hash)
|
||||
if (string_is_equal(label, setting->name)
|
||||
&& (setting_get_type(setting) <= ST_GROUP))
|
||||
{
|
||||
const char *name = setting->name;
|
||||
const char *short_description = setting->short_description;
|
||||
/* make sure this isn't a collision */
|
||||
if (!string_is_equal(label, name))
|
||||
continue;
|
||||
|
||||
if (string_is_empty(short_description))
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user