summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-04-17 17:13:20 +0200
committerThomas Haller <thaller@redhat.com>2019-04-18 17:53:09 +0200
commitb74d9a0bd5703f499c9bd432e85b89eb3f455cb7 (patch)
treec746ca45112453520708f17468498317558ea342
parent3f5df5ab7249141d08b0693a38f113e5bf2b3241 (diff)
downloadNetworkManager-b74d9a0bd5703f499c9bd432e85b89eb3f455cb7.tar.gz
cli: return early when splitting with %VALUE_STRSPLIT_MODE_STRIPPED
The reminder of the function only does (something akin to) g_strstrip(). As we split the strings are spaces to begin with, there is nothing to strip and we can return right away.
-rw-r--r--clients/common/nm-meta-setting-desc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index 9260f6eff5..65737d8032 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -201,7 +201,8 @@ _value_strsplit (const char *value,
switch (split_mode) {
case VALUE_STRSPLIT_MODE_STRIPPED:
strv = nm_utils_strsplit_set (value, NM_ASCII_SPACES",");
- break;
+ NM_SET_OUT (out_len, NM_PTRARRAY_LEN (strv));
+ return g_steal_pointer (&strv);
case VALUE_STRSPLIT_MODE_OBJLIST:
strv = nm_utils_strsplit_set (value, ",");
break;