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)
|
if (!conf || !key || !val)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
last = (conf->guaranteed_no_duplicates && conf->last) ?
|
last = conf->entries;
|
||||||
conf->last : conf->entries;
|
|
||||||
entry = conf->guaranteed_no_duplicates ?
|
if (conf->guaranteed_no_duplicates)
|
||||||
NULL : config_get_entry(conf, key, &last);
|
{
|
||||||
|
if (conf->last)
|
||||||
|
last = conf->last;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entry = config_get_entry(conf, key, &last);
|
||||||
|
|
||||||
if (entry)
|
if (entry)
|
||||||
{
|
{
|
||||||
|
@ -997,6 +1003,7 @@ void config_set_string(config_file_t *conf, const char *key, const char *val)
|
||||||
conf->modified = true;
|
conf->modified = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Entry corresponding to 'key' does not exist
|
/* Entry corresponding to 'key' does not exist
|
||||||
* > Create new entry */
|
* > Create new entry */
|
||||||
|
|
Loading…
Reference in New Issue