mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-15 18:30:38 +01:00
keyfile: simplify code path in write_setting_value()
Avoid nested blocks. Check one condition after the other and handle it.
This commit is contained in:
parent
a0db72bf6d
commit
cfe594903e
1 changed files with 8 additions and 7 deletions
|
|
@ -3849,6 +3849,14 @@ write_setting_value(KeyfileWriterInfo *info,
|
|||
|
||||
_parse_info_find(setting, key, &setting_info, NULL, &pip);
|
||||
|
||||
if (pip && pip->has_writer_full) {
|
||||
pip->writer_full(info, setting_info, property_info, pip, setting);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pip && pip->writer_skip)
|
||||
return;
|
||||
|
||||
if (!pip) {
|
||||
if (!setting_info) {
|
||||
/* the setting type is unknown. That is highly unexpected
|
||||
|
|
@ -3865,13 +3873,6 @@ write_setting_value(KeyfileWriterInfo *info,
|
|||
return;
|
||||
if (nm_streq(key, NM_SETTING_NAME))
|
||||
return;
|
||||
} else {
|
||||
if (pip->has_writer_full) {
|
||||
pip->writer_full(info, setting_info, property_info, pip, setting);
|
||||
return;
|
||||
}
|
||||
if (pip->writer_skip)
|
||||
return;
|
||||
}
|
||||
|
||||
nm_assert(property_info->param_spec);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue