utils: save duplicate lookup of path in nm_utils_g_value_set_object_path_array()
This commit is contained in:
@@ -3471,12 +3471,14 @@ nm_utils_g_value_set_object_path_array (GValue *value,
|
|||||||
paths = g_new (char *, g_slist_length (objects) + 1);
|
paths = g_new (char *, g_slist_length (objects) + 1);
|
||||||
for (i = 0, iter = objects; iter; iter = iter->next) {
|
for (i = 0, iter = objects; iter; iter = iter->next) {
|
||||||
NMExportedObject *object = iter->data;
|
NMExportedObject *object = iter->data;
|
||||||
|
const char *path;
|
||||||
|
|
||||||
if (!nm_exported_object_is_exported (object))
|
path = nm_exported_object_get_path (object);
|
||||||
|
if (!path)
|
||||||
continue;
|
continue;
|
||||||
if (filter_func && !filter_func ((GObject *) object, user_data))
|
if (filter_func && !filter_func ((GObject *) object, user_data))
|
||||||
continue;
|
continue;
|
||||||
paths[i++] = g_strdup (nm_exported_object_get_path (object));
|
paths[i++] = g_strdup (path);
|
||||||
}
|
}
|
||||||
paths[i] = NULL;
|
paths[i] = NULL;
|
||||||
g_value_take_boxed (value, paths);
|
g_value_take_boxed (value, paths);
|
||||||
|
Reference in New Issue
Block a user