diff options
author | Thomas Haller <thaller@redhat.com> | 2022-12-01 16:16:51 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-12-09 09:15:53 +0100 |
commit | 977c1e76a85abdbf93372ac07c9e3663e2390b7f (patch) | |
tree | da43f387c461a092c6e270807d65d7ab19e4bc3f /src/nmcli | |
parent | cfc6e63403ae0d22d14ba8b5c9e9d934d7dcc70b (diff) | |
download | NetworkManager-977c1e76a85abdbf93372ac07c9e3663e2390b7f.tar.gz |
all: use nm_g_array_first()/nm_g_array_first_p() where suitable
Diffstat (limited to 'src/nmcli')
-rw-r--r-- | src/nmcli/connections.c | 2 | ||||
-rw-r--r-- | src/nmcli/utils.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index e5fbb3e490..c0b7d8f1dc 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -1983,7 +1983,7 @@ con_show_get_items_cmp(gconstpointer pa, gconstpointer pb, gpointer user_data) nmc_print_output_to_accessor_get_type(sort_info->nmc->nmc_config.print_output); if (sort_info->order) { - order_arr = nm_g_array_index_p(sort_info->order, NmcSortOrder, 0); + order_arr = nm_g_array_first_p(sort_info->order, NmcSortOrder); order_len = sort_info->order->len; } else { static const NmcSortOrder def[] = {NMC_SORT_ACTIVE, NMC_SORT_NAME, NMC_SORT_PATH}; diff --git a/src/nmcli/utils.c b/src/nmcli/utils.c index ebe234706a..8eb9fa950a 100644 --- a/src/nmcli/utils.c +++ b/src/nmcli/utils.c @@ -1410,8 +1410,8 @@ nmc_print(const NmcConfig *nmc_config, header_name_no_l10n, header_row->len, cells->len / header_row->len, - nm_g_array_index_p(header_row, PrintDataHeaderCell, 0), - nm_g_array_index_p(cells, PrintDataCell, 0)); + nm_g_array_first_p(header_row, PrintDataHeaderCell), + nm_g_array_first_p(cells, PrintDataCell)); return TRUE; } |