提交 83a27d4d 编写于 作者: L Luiz Capitulino

QMP: Simplify monitor_json_emitter()

Use the ternary operator instead of an if (also fixes bad indentation).
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 6d441430
......@@ -351,10 +351,8 @@ static void monitor_json_emitter(Monitor *mon, const QObject *data)
{
QString *json;
if (mon->flags & MONITOR_USE_PRETTY)
json = qobject_to_json_pretty(data);
else
json = qobject_to_json(data);
json = mon->flags & MONITOR_USE_PRETTY ? qobject_to_json_pretty(data) :
qobject_to_json(data);
assert(json != NULL);
qstring_append_chr(json, '\n');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册