qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: anthony@codemonkey.ws
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/4] QMP: Simplify monitor_json_emitter()
Date: Mon,  6 Dec 2010 12:43:50 -0200	[thread overview]
Message-ID: <1291646631-4609-4-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1291646631-4609-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 1e8b1fc..f1aebc1 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.3.398.g0b0cd

  parent reply	other threads:[~2010-12-06 14:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 14:43 [Qemu-devel] [PULL 0/4]: Monitor queue Luiz Capitulino
2010-12-06 14:43 ` [Qemu-devel] [PATCH 1/4] QMP: Fix default response regression Luiz Capitulino
2010-12-06 14:43 ` [Qemu-devel] [PATCH 2/4] QMP: Drop dead code Luiz Capitulino
2010-12-06 14:43 ` Luiz Capitulino [this message]
2010-12-06 14:43 ` [Qemu-devel] [PATCH 4/4] correct migrate_set_speed's args_type Luiz Capitulino
2010-12-17 14:48 ` [Qemu-devel] [PULL 0/4]: Monitor queue Anthony Liguori

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=1291646631-4609-4-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=anthony@codemonkey.ws \
    --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).