summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-13 12:17:07 +0100
committerThomas Haller <thaller@redhat.com>2020-03-16 13:44:12 +0100
commit5bef7d7453ae050698c888901f57563a8be6df77 (patch)
tree85a0998771dd3fdcc9649037f62d385d071cf7d2
parent3cc99c9f8c87a0d3ee29041fa7b18f6e55a3e996 (diff)
downloadNetworkManager-5bef7d7453ae050698c888901f57563a8be6df77.tar.gz
cli: minor cleanup dropping unnecessary local variables
-rw-r--r--clients/cli/utils.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/clients/cli/utils.c b/clients/cli/utils.c
index 6dcb97b9fc..d35ed26631 100644
--- a/clients/cli/utils.c
+++ b/clients/cli/utils.c
@@ -662,7 +662,6 @@ _output_selection_append (GArray *cols,
guint i;
const NMMetaAbstractInfo *const*nested;
NMMetaSelectionResultList *selection;
- const NMMetaSelectionItem *si;
col_idx = cols->len;
@@ -683,6 +682,8 @@ _output_selection_append (GArray *cols,
gs_free char *allowed_fields = NULL;
if (parent_idx != PRINT_DATA_COL_PARENT_NIL) {
+ const NMMetaSelectionItem *si;
+
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);
}
@@ -714,10 +715,9 @@ _output_selection_append (GArray *cols,
g_ptr_array_add (gfree_keeper, selection);
for (i = 0; i < selection->num; i++) {
- si = &selection->items[i];
if (!_output_selection_append (cols,
col_idx,
- si,
+ &selection->items[i],
gfree_keeper,
error))
return FALSE;
@@ -799,10 +799,11 @@ _output_selection_parse (const NMMetaAbstractInfo *const*fields,
cols = g_array_new (FALSE, TRUE, sizeof (PrintDataCol));
for (i = 0; i < selection->num; i++) {
- const NMMetaSelectionItem *si = &selection->items[i];
-
- if (!_output_selection_append (cols, PRINT_DATA_COL_PARENT_NIL,
- si, gfree_keeper, error))
+ if (!_output_selection_append (cols,
+ PRINT_DATA_COL_PARENT_NIL,
+ &selection->items[i],
+ gfree_keeper,
+ error))
return FALSE;
}