qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/3] QMP: Simplify monitor_json_emitter()
Date: Tue, 23 Nov 2010 16:49:35 -0200	[thread overview]
Message-ID: <1290538175-2437-4-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1290538175-2437-1-git-send-email-lcapitulino@redhat.com>

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

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 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

  parent reply	other threads:[~2010-11-23 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 18:49 [Qemu-devel] [PATCH 0/3] QMP: small fixes Luiz Capitulino
2010-11-23 18:49 ` [Qemu-devel] [PATCH 1/3] QMP: Fix default response regression Luiz Capitulino
2010-11-23 18:49 ` [Qemu-devel] [PATCH 2/3] QMP: Drop dead code Luiz Capitulino
2010-12-14 15:23   ` Markus Armbruster
2010-11-23 18:49 ` Luiz Capitulino [this message]
2010-12-14 15:23 ` [Qemu-devel] [PATCH 0/3] QMP: small fixes Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290538175-2437-4-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).