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.

(cherry picked from commit b74d9a0bd5)
This commit is contained in:
Thomas Haller 2019-04-17 17:13:20 +02:00
parent 55a46f91e5
commit 53b3e3d709

View file

@ -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;