qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH for-5.1 2/5] qobject: Factor out helper json_pretty_newline()


From: Eric Blake
Subject: Re: [PATCH for-5.1 2/5] qobject: Factor out helper json_pretty_newline()
Date: Wed, 15 Apr 2020 07:28:13 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

On 4/15/20 3:30 AM, Markus Armbruster wrote:
Signed-off-by: Markus Armbruster <address@hidden>
---
  qobject/qjson.c | 40 ++++++++++++++++------------------------
  1 file changed, 16 insertions(+), 24 deletions(-)

diff --git a/qobject/qjson.c b/qobject/qjson.c
index db36101f3b..f3c62711b9 100644
--- a/qobject/qjson.c
+++ b/qobject/qjson.c
@@ -159,21 +159,28 @@ typedef struct ToJsonIterState
static void to_json(const QObject *obj, QString *str, int pretty, int indent); +static void json_pretty_newline(QString *str, bool pretty, int indent)
+{
+    int i;
+
+    if (pretty) {
+        qstring_append(str, "\n");
+        for (i = 0 ; i < indent ; i++) {

Why are you keeping the spaces before ; ? Yes, I know they were copied-and-pasted from the old code, but as long as you are refactoring, fixing the style is worthwhile.

Otherwise,
Reviewed-by: Eric Blake <address@hidden>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

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