qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/3] QMP: Simplify monitor_json_emitter()


From: Luiz Capitulino
Subject: [Qemu-devel] [PATCH 3/3] QMP: Simplify monitor_json_emitter()
Date: Tue, 23 Nov 2010 16:49:35 -0200

Use the ternary operator instead of an if (also fixes bad indentation).

Signed-off-by: Luiz Capitulino <address@hidden>
---
 monitor.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/monitor.c b/monitor.c
index 30be273..f6f2264 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');
-- 
1.7.3.2.245.g03276




reply via email to

[Prev in Thread] Current Thread [Next in Thread]