From d70d838ab1b283ea17be210778d6b2f8309ca260 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 14 Jun 2015 16:30:44 +0200 Subject: [PATCH] (menu_cbs_ok.c) Refactor away usage of strcmp --- menu/cbs/menu_cbs_ok.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 90c9c7f984..3871f12d10 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -160,6 +160,7 @@ static int action_ok_file_load_detect_core(const char *path, static int action_ok_playlist_entry(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { + uint32_t core_name_hash, core_path_hash; const char *entry_path = NULL; const char *entry_label = NULL; const char *core_path = NULL; @@ -205,8 +206,13 @@ static int action_ok_playlist_entry(const char *path, core_path, core_name, selection_ptr); #endif - if (core_path && core_path[0] != '\0' && core_name && - core_name[0] != '\0' && !strcmp(core_path, "DETECT") && !strcmp(core_name, "DETECT")) + core_path_hash = core_path ? djb2_calculate(core_path) : 0; + core_name_hash = core_name ? djb2_calculate(core_name) : 0; + + if ( + (core_path_hash == MENU_VALUE_DETECT) && + (core_name_hash == MENU_VALUE_DETECT) + ) return action_ok_file_load_with_detect_core(entry_path, label, type, selection_ptr, entry_idx); rarch_playlist_load_content(playlist, selection_ptr);