diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2010-11-22 17:10:37 -0200 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2010-12-06 09:51:41 -0200 |
commit | 83a27d4d1c7e6179bd6e5e8bfa505f62c402e999 (patch) | |
tree | dbcbaa48569dbbf22603dccd96718298390fe707 | |
parent | 6d44143054293995c5e92fbddbd1ee92846013cc (diff) |
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>
-rw-r--r-- | monitor.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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'); |