cli: minor cleanup dropping unnecessary local variables

This commit is contained in:
Thomas Haller
2020-03-13 12:17:07 +01:00
parent 3cc99c9f8c
commit 5bef7d7453

View File

@@ -662,7 +662,6 @@ _output_selection_append (GArray *cols,
guint i; guint i;
const NMMetaAbstractInfo *const*nested; const NMMetaAbstractInfo *const*nested;
NMMetaSelectionResultList *selection; NMMetaSelectionResultList *selection;
const NMMetaSelectionItem *si;
col_idx = cols->len; col_idx = cols->len;
@@ -683,6 +682,8 @@ _output_selection_append (GArray *cols,
gs_free char *allowed_fields = NULL; gs_free char *allowed_fields = NULL;
if (parent_idx != PRINT_DATA_COL_PARENT_NIL) { if (parent_idx != PRINT_DATA_COL_PARENT_NIL) {
const NMMetaSelectionItem *si;
si = g_array_index (cols, PrintDataCol, parent_idx).selection_item; si = g_array_index (cols, PrintDataCol, parent_idx).selection_item;
allowed_fields = nm_meta_abstract_info_get_nested_names_str (si->info, si->self_selection); allowed_fields = nm_meta_abstract_info_get_nested_names_str (si->info, si->self_selection);
} }
@@ -714,10 +715,9 @@ _output_selection_append (GArray *cols,
g_ptr_array_add (gfree_keeper, selection); g_ptr_array_add (gfree_keeper, selection);
for (i = 0; i < selection->num; i++) { for (i = 0; i < selection->num; i++) {
si = &selection->items[i];
if (!_output_selection_append (cols, if (!_output_selection_append (cols,
col_idx, col_idx,
si, &selection->items[i],
gfree_keeper, gfree_keeper,
error)) error))
return FALSE; return FALSE;
@@ -799,10 +799,11 @@ _output_selection_parse (const NMMetaAbstractInfo *const*fields,
cols = g_array_new (FALSE, TRUE, sizeof (PrintDataCol)); cols = g_array_new (FALSE, TRUE, sizeof (PrintDataCol));
for (i = 0; i < selection->num; i++) { for (i = 0; i < selection->num; i++) {
const NMMetaSelectionItem *si = &selection->items[i]; if (!_output_selection_append (cols,
PRINT_DATA_COL_PARENT_NIL,
if (!_output_selection_append (cols, PRINT_DATA_COL_PARENT_NIL, &selection->items[i],
si, gfree_keeper, error)) gfree_keeper,
error))
return FALSE; return FALSE;
} }