Commit 01e7cb11 authored by Thomas Haller's avatar Thomas Haller

libnm: don't return deep-copied strv array from nm_tc_qdisc_get_attribute_names()

Most of the caller won't require a deep-clone of the attribute
names. Likely, the fetch the name, so they can lookup the attributes.
In that common case, there is no need to clone the strings themself.
parent 48316f98
Pipeline #32122 canceled with stage
in 21 minutes and 57 seconds
......@@ -327,19 +327,17 @@ nm_tc_qdisc_get_parent (NMTCQdisc *qdisc)
*
* Gets an array of attribute names defined on @qdisc.
*
* Returns: (transfer full): a %NULL-terminated array of attribute names,
* Returns: (transfer container): a %NULL-terminated array of attribute names
* or %NULL if no attributes are set.
*
* Since: 1.18
**/
char **
const char **
nm_tc_qdisc_get_attribute_names (NMTCQdisc *qdisc)
{
const char **names;
g_return_val_if_fail (qdisc, NULL);
names = nm_utils_strdict_get_keys (qdisc->attributes, TRUE, NULL);
return nm_utils_strv_make_deep_copied_nonnull (names);
return nm_utils_strdict_get_keys (qdisc->attributes, TRUE, NULL);
}
GHashTable *
......
......@@ -60,7 +60,7 @@ NM_AVAILABLE_IN_1_12
guint32 nm_tc_qdisc_get_parent (NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_18
char**nm_tc_qdisc_get_attribute_names (NMTCQdisc *qdisc);
const char **nm_tc_qdisc_get_attribute_names (NMTCQdisc *qdisc);
NM_AVAILABLE_IN_1_18
GVariant *nm_tc_qdisc_get_attribute (NMTCQdisc *qdisc,
const char *name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment