projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d44143
)
QMP: Simplify monitor_json_emitter()
author
Luiz Capitulino
<lcapitulino@redhat.com>
Mon, 22 Nov 2010 19:10:37 +0000
(17:10 -0200)
committer
Luiz Capitulino
<lcapitulino@redhat.com>
Mon, 6 Dec 2010 11:51:41 +0000
(09:51 -0200)
Use the ternary operator instead of an if (also fixes bad indentation).
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor.c
patch
|
blob
|
history
diff --git
a/monitor.c
b/monitor.c
index 1e8b1fc9bc80618c000b1203d039f8bf53e6185a..f1aebc10f1a5c7e95f54b81433d78a3dc149c717 100644
(file)
--- 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');