libnm: drop unused nm_strv_to_ptrarray() helper

It also doesn't make much sense to have this. We may use a
GPtrArray to construct and keep track of a (dynamic) strv list.
Then we add the strings to the GPtrArray one by one.

We almost never will want to create a GPtrArray based on a strv array.
This commit is contained in:
Thomas Haller
2023-11-17 09:51:36 +01:00
parent 7c16eb36ab
commit 0b95cd5b80
2 changed files with 0 additions and 19 deletions

View File

@@ -897,24 +897,6 @@ _nm_utils_slist_to_strv(const GSList *slist, gboolean deep_copy)
return strv;
}
GPtrArray *
nm_strv_to_ptrarray(char **strv)
{
GPtrArray *ptrarray;
gsize i, l;
l = NM_PTRARRAY_LEN(strv);
ptrarray = g_ptr_array_new_full(l, g_free);
if (strv) {
for (i = 0; strv[i]; i++)
g_ptr_array_add(ptrarray, g_strdup(strv[i]));
}
return ptrarray;
}
char **
_nm_utils_ptrarray_to_strv(const GPtrArray *ptrarray)
{

View File

@@ -347,7 +347,6 @@ GPtrArray *_nm_utils_copy_object_array(const GPtrArray *array);
GSList *nm_strv_to_gslist(char **strv, gboolean deep_copy);
char **_nm_utils_slist_to_strv(const GSList *slist, gboolean deep_copy);
GPtrArray *nm_strv_to_ptrarray(char **strv);
char **_nm_utils_ptrarray_to_strv(const GPtrArray *ptrarray);
gboolean _nm_utils_check_file(const char *filename,