config_set_string: simplify
This commit is contained in:
parent
a954118faf
commit
b681b2af49
|
@ -968,10 +968,16 @@ void config_set_string(config_file_t *conf, const char *key, const char *val)
|
|||
if (!conf || !key || !val)
|
||||
return;
|
||||
|
||||
last = (conf->guaranteed_no_duplicates && conf->last) ?
|
||||
conf->last : conf->entries;
|
||||
entry = conf->guaranteed_no_duplicates ?
|
||||
NULL : config_get_entry(conf, key, &last);
|
||||
last = conf->entries;
|
||||
|
||||
if (conf->guaranteed_no_duplicates)
|
||||
{
|
||||
if (conf->last)
|
||||
last = conf->last;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = config_get_entry(conf, key, &last);
|
||||
|
||||
if (entry)
|
||||
{
|
||||
|
@ -997,6 +1003,7 @@ void config_set_string(config_file_t *conf, const char *key, const char *val)
|
|||
conf->modified = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Entry corresponding to 'key' does not exist
|
||||
* > Create new entry */
|
||||
|
|
Loading…
Reference in New Issue