提交 8c1cedb4 编写于 作者: T Taeung Song 提交者: Arnaldo Carvalho de Melo

perf config: Invert an if statement to reduce nesting in cmd_config()

Signed-off-by: NTaeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1494241650-32210-1-git-send-email-treeze.taeung@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 ec27ae18
......@@ -204,7 +204,11 @@ int cmd_config(int argc, const char **argv)
}
break;
default:
if (argc) {
if (!argc) {
usage_with_options(config_usage, config_options);
break;
}
for (i = 0; argv[i]; i++) {
char *var, *value;
char *arg = strdup(argv[i]);
......@@ -227,8 +231,6 @@ int cmd_config(int argc, const char **argv)
ret = set_config(set, config_filename, var, value);
free(arg);
}
} else
usage_with_options(config_usage, config_options);
}
perf_config_set__delete(set);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册