QMP: Simplify monitor_json_emitter()
Use the ternary operator instead of an if (also fixes bad indentation). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
6d44143054
commit
83a27d4d1c
@ -351,10 +351,8 @@ static void monitor_json_emitter(Monitor *mon, const QObject *data)
|
|||||||
{
|
{
|
||||||
QString *json;
|
QString *json;
|
||||||
|
|
||||||
if (mon->flags & MONITOR_USE_PRETTY)
|
json = mon->flags & MONITOR_USE_PRETTY ? qobject_to_json_pretty(data) :
|
||||||
json = qobject_to_json_pretty(data);
|
qobject_to_json(data);
|
||||||
else
|
|
||||||
json = qobject_to_json(data);
|
|
||||||
assert(json != NULL);
|
assert(json != NULL);
|
||||||
|
|
||||||
qstring_append_chr(json, '\n');
|
qstring_append_chr(json, '\n');
|
||||||
|
Loading…
Reference in New Issue
Block a user