mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
pipewire: parse_pw_debug_env(): split in place
There is no need to use `pw_split_strv()` since the string is owned by the function, it can be split in place, so do that.
This commit is contained in:
parent
656d8bbc72
commit
3506b7534c
1 changed files with 3 additions and 6 deletions
|
|
@ -520,12 +520,11 @@ parse_pw_debug_env(void)
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < n_tokens; i++) {
|
for (i = 0; i < n_tokens; i++) {
|
||||||
int n_tok;
|
int n_tok;
|
||||||
char **tok;
|
char *tok[2];
|
||||||
char *pattern;
|
|
||||||
|
|
||||||
tok = pw_split_strv(tokens[i], ":", 2, &n_tok);
|
n_tok = pw_split_ip(tokens[i], ":", SPA_N_ELEMENTS(tok), tok);
|
||||||
if (n_tok == 2 && parse_log_level(tok[1], &lvl)) {
|
if (n_tok == 2 && parse_log_level(tok[1], &lvl)) {
|
||||||
pattern = tok[0];
|
char *pattern = tok[0];
|
||||||
pos += spa_scnprintf(pos, end - pos, "{ %s = %d },",
|
pos += spa_scnprintf(pos, end - pos, "{ %s = %d },",
|
||||||
pattern, lvl);
|
pattern, lvl);
|
||||||
} else if (n_tok == 1 && parse_log_level(tok[0], &lvl)) {
|
} else if (n_tok == 1 && parse_log_level(tok[0], &lvl)) {
|
||||||
|
|
@ -534,8 +533,6 @@ parse_pw_debug_env(void)
|
||||||
pw_log_warn("Ignoring invalid format in PIPEWIRE_DEBUG: '%s'",
|
pw_log_warn("Ignoring invalid format in PIPEWIRE_DEBUG: '%s'",
|
||||||
tokens[i]);
|
tokens[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_free_strv(tok);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pw_free_strv(tokens);
|
pw_free_strv(tokens);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue