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: Markus Armbruster
Subject: Re: [PATCH for-5.1 2/5] qobject: Factor out helper json_pretty_newline()
Date: Wed, 15 Apr 2020 16:46:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Eric Blake <address@hidden> writes:

> 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.

Makes sense.

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

Thanks!




reply via email to

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