Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5UbX-0005sm-GJ for pgsql-committers@arkaria.postgresql.org; Sun, 17 Mar 2019 12:09:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5UbV-00041V-8E for pgsql-committers@arkaria.postgresql.org; Sun, 17 Mar 2019 12:09:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5UbV-00041M-0I for pgsql-committers@lists.postgresql.org; Sun, 17 Mar 2019 12:09:25 +0000 Received: from cyclops.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5UbS-0001we-7V for pgsql-committers@lists.postgresql.org; Sun, 17 Mar 2019 12:09:24 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id EF3A621C489E for ; Sun, 17 Mar 2019 15:09:20 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from mail-it1-f177.google.com (mail-it1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (not verified)) by mail.postgrespro.ru (Postfix) with ESMTPSA id 7881121C4873 for ; Sun, 17 Mar 2019 15:09:20 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1552824560; bh=dWuVnLZgX7IgsMepHVx0IReg1fkG8PFx8vfwNsQzuo8=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=K6WTzejoo9Tf7vxvAG3XLe0ByGSZPqmIUM2i5afqbYMqKRmXZjdD3kc5DtunNS4uq zdpWOU3IFO+mk79dbavn9bjNpfA7UbeYwr4WqlIJ/JragOCVslED3t2L89sb4nNbo4 60D1AgFH+qwvklsjIoovp6RSyYN8TBb0izULVDsU= Received: by mail-it1-f177.google.com with SMTP id z124so17308902itc.2 for ; Sun, 17 Mar 2019 05:09:20 -0700 (PDT) X-Gm-Message-State: APjAAAUqZ1PluJ8/6WndrhUuWrVbVCW9/VnFVk0chOxeWT5Ob81MNwxl mB7tx6Q9SEfratwkAx13NnpgToAtvAz3UG4Y5n8= X-Google-Smtp-Source: APXvYqwcHyf3DT0o+pcUAy7ivsRO3jkZGNP9e57JEGZse2Q6bzlzyLZgzuSQ1eTp3CcBo+ZwUfVZ3xMEMrF60V+tIcs= X-Received: by 2002:a24:3554:: with SMTP id k81mr6505350ita.41.1552824558851; Sun, 17 Mar 2019 05:09:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alexander Korotkov Date: Sun, 17 Mar 2019 15:09:07 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pgsql: Beautify initialization of JsonValueList and JsonLikeRegexContex To: Peter Eisentraut Cc: Alexander Korotkov , pgsql-committers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Mar 17, 2019 at 3:00 PM Peter Eisentraut wrote: > On 2019-03-17 10:59, Alexander Korotkov wrote: > > Beautify initialization of JsonValueList and JsonLikeRegexContext > > > > Instead of tricky assignment to {0} introduce special macros, which > > explicitly initialize every field. > > To me, this patch is exactly the opposite of what I'd do to "beautify > initialization". It doesn't seem sustainable to me to create a special > macro for every structure in the code, not does it improve readability. > It is much clearer that {0} is uniformly the starting state. I got two reasons in the mind while committing that: 1) We would probably like to make some values of empty state non-zero in future. 2) In general, it's better to not assume that NULL is binary zero. However, we assume that a lot in other places. So, it probably doesn't matter. Anyway, I thought about this as about just beautification. If it's bad idea, let's revert this. ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company