mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 13:20:43 +00:00
Simplify config_get_bool
This commit is contained in:
parent
48f2612223
commit
54dfaaa3bc
@ -1000,21 +1000,29 @@ bool config_get_bool(config_file_t *conf, const char *key, bool *in)
|
||||
{
|
||||
const struct config_entry_list *entry = config_get_entry(conf, key, NULL);
|
||||
|
||||
if (entry)
|
||||
{
|
||||
if (string_is_equal(entry->value, "true"))
|
||||
if (!entry)
|
||||
return false;
|
||||
|
||||
if (
|
||||
(
|
||||
entry->value[0] == '1'
|
||||
&& entry->value[1] == '\0'
|
||||
)
|
||||
|| string_is_equal(entry->value, "true")
|
||||
)
|
||||
*in = true;
|
||||
else if (string_is_equal(entry->value, "1"))
|
||||
*in = true;
|
||||
else if (string_is_equal(entry->value, "false"))
|
||||
*in = false;
|
||||
else if (string_is_equal(entry->value, "0"))
|
||||
else if (
|
||||
(
|
||||
entry->value[0] == '0'
|
||||
&& entry->value[1] == '\0'
|
||||
)
|
||||
|| string_is_equal(entry->value, "false")
|
||||
)
|
||||
*in = false;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
return entry != NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
void config_set_string(config_file_t *conf, const char *key, const char *val)
|
||||
|
Loading…
x
Reference in New Issue
Block a user