From: Luiz Capitulino Date: Mon, 22 Nov 2010 19:10:37 +0000 (-0200) Subject: QMP: Simplify monitor_json_emitter() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=83a27d4d1c7e6179bd6e5e8bfa505f62c402e999;p=qemu.git QMP: Simplify monitor_json_emitter() Use the ternary operator instead of an if (also fixes bad indentation). Signed-off-by: Luiz Capitulino --- diff --git a/monitor.c b/monitor.c index 1e8b1fc9bc..f1aebc10f1 100644 --- a/monitor.c +++ b/monitor.c @@ -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');