From f994c0b37172f1f2bd969bf24098b012ca7d14d5 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Tue, 19 Jul 2022 21:00:40 +0200 Subject: [PATCH] Get rid of superfluous wrapper function config_entry_exists --- configuration.c | 7 ++++--- libretro-common/file/config_file.c | 5 ----- libretro-common/include/file/config_file.h | 2 -- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/configuration.c b/configuration.c index 64c0e5fb9b..9ee344988f 100644 --- a/configuration.c +++ b/configuration.c @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H #include "config.h" @@ -3778,7 +3779,7 @@ static bool config_load_file(global_t *global, frontend_driver_set_sustained_performance_mode(settings->bools.sustained_performance_mode); recording_driver_update_streaming_url(); - if (!config_entry_exists(conf, "user_language")) + if (!(bool)RHMAP_HAS_STR(conf->entries_map, "user_language")) msg_hash_set_uint(MSG_HASH_USER_LANGUAGE, frontend_driver_get_user_language()); if (frontend_driver_has_gamemode() && @@ -3796,8 +3797,8 @@ static bool config_load_file(global_t *global, * history playlist size limit. (Have to do this, otherwise * users with large custom history size limits may lose * favourites entries when updating RetroArch...) */ - if ( config_entry_exists(conf, "content_history_size") && - !config_entry_exists(conf, "content_favorites_size")) + if ( (bool)RHMAP_HAS_STR(conf->entries_map, "content_history_size") && + !(bool)RHMAP_HAS_STR(conf->entries_map, "content_favorites_size")) { if (settings->uints.content_history_size > 999) settings->ints.content_favorites_size = -1; diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index b0633ebcb1..a46f8adafb 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -1369,11 +1369,6 @@ void config_file_dump(config_file_t *conf, FILE *file, bool sort) } } -bool config_entry_exists(config_file_t *conf, const char *entry) -{ - return (bool)RHMAP_HAS_STR(conf->entries_map, entry); -} - bool config_get_entry_list_head(config_file_t *conf, struct config_file_entry *entry) { diff --git a/libretro-common/include/file/config_file.h b/libretro-common/include/file/config_file.h index 6c48b5bd81..2fdb145c88 100644 --- a/libretro-common/include/file/config_file.h +++ b/libretro-common/include/file/config_file.h @@ -120,8 +120,6 @@ bool config_append_file(config_file_t *conf, const char *path); /* All extract functions return true when value is valid and exists. * Returns false otherwise. */ -bool config_entry_exists(config_file_t *conf, const char *entry); - struct config_entry_list { char *key;