From 3aea25479cc2dcece07ef30aee03a3b3fccf942e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Sep 2016 16:54:01 +0200 Subject: [PATCH] Cleanups --- command.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/command.c b/command.c index 70572bb4ca..9a22f9bdea 100644 --- a/command.c +++ b/command.c @@ -1451,27 +1451,21 @@ static bool command_event_save_auto_state(void) static bool command_event_save_config(const char *config_path, char *s, size_t len) { - bool ret = false; - - if (config_path) - ret = config_save_file(config_path); - - if (ret) + if (config_save_file(config_path)) { snprintf(s, len, "%s \"%s\".", msg_hash_to_str(MSG_SAVED_NEW_CONFIG_TO), path_get_config()); RARCH_LOG("%s\n", s); - } - else - { - snprintf(s, len, "%s \"%s\".", - msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO), - path_get_config()); - RARCH_ERR("%s\n", s); + return true; } - return ret; + snprintf(s, len, "%s \"%s\".", + msg_hash_to_str(MSG_FAILED_SAVING_CONFIG_TO), + path_get_config()); + RARCH_ERR("%s\n", s); + + return false; } /** @@ -1606,16 +1600,12 @@ void command_event_save_current_config(int override_type) { settings_t *settings = config_get_ptr(); + /* Save last core-specific config to the default config location, + * needed on consoles for core switching and reusing last good + * config for new cores. + */ if (settings->config_save_on_exit && !path_is_config_empty()) - { - /* Save last core-specific config to the default config location, - * needed on consoles for core switching and reusing last good - * config for new cores. - */ - - /* Flush out the core specific config. */ command_event_save_config(path_get_config(), msg, sizeof(msg)); - } } if (!string_is_empty(msg))