Re: Improve readability by using designated initializers when possible

Поиск
Список
Период
Сортировка
От Japin Li
Тема Re: Improve readability by using designated initializers when possible
Дата
Msg-id SYZP282MB3169CB84400C1482A79C90CBB65A2@SYZP282MB3169.AUSP282.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответ на Re: Improve readability by using designated initializers when possible  (jian he <jian.universality@gmail.com>)
Ответы Re: Improve readability by using designated initializers when possible  (Michael Paquier <michael@paquier.xyz>)
Re: Improve readability by using designated initializers when possible  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Mon, 26 Feb 2024 at 16:41, jian he <jian.universality@gmail.com> wrote:
> Hi. minor issues.
>
> @@ -2063,12 +2009,12 @@ find_expr_references_walker(Node *node,
>   CoerceViaIO *iocoerce = (CoerceViaIO *) node;
>
>   /* since there is no exposed function, need to depend on type */
> - add_object_address(OCLASS_TYPE, iocoerce->resulttype, 0,
> + add_object_address(TypeRelationId iocoerce->resulttype, 0,
>     context->addrs);
>
> @@ -2090,21 +2036,21 @@ find_expr_references_walker(Node *node,
>   ConvertRowtypeExpr *cvt = (ConvertRowtypeExpr *) node;
>
>   /* since there is no function dependency, need to depend on type */
> - add_object_address(OCLASS_TYPE, cvt->resulttype, 0,
> + add_object_address(TypeRelationId cvt->resulttype, 0,
>     context->addrs);
>
> obvious typo errors.
>
> diff --git a/src/common/relpath.c b/src/common/relpath.c
> index b16fe19dea6..d9214f915c9 100644
> --- a/src/common/relpath.c
> +++ b/src/common/relpath.c
> @@ -31,10 +31,10 @@
>   * pg_relation_size().
>   */
>  const char *const forkNames[] = {
> - "main", /* MAIN_FORKNUM */
> - "fsm", /* FSM_FORKNUM */
> - "vm", /* VISIBILITYMAP_FORKNUM */
> - "init" /* INIT_FORKNUM */
> + [MAIN_FORKNUM] = "main",
> + [FSM_FORKNUM] = "fsm",
> + [VISIBILITYMAP_FORKNUM] = "vm",
> + [INIT_FORKNUM] = "init",
>  };
>
> `+ [INIT_FORKNUM] = "init", ` no need for an extra  comma?
>
> + [PG_SJIS] = {0, 0, pg_sjis_mblen, pg_sjis_dsplen,
> pg_sjis_verifychar, pg_sjis_verifystr, 2},
> + [PG_BIG5] = {0, 0, pg_big5_mblen, pg_big5_dsplen,
> pg_big5_verifychar, pg_big5_verifystr, 2},
> + [PG_GBK] = {0, 0, pg_gbk_mblen, pg_gbk_dsplen, pg_gbk_verifychar,
> pg_gbk_verifystr, 2},
> + [PG_UHC] = {0, 0, pg_uhc_mblen, pg_uhc_dsplen, pg_uhc_verifychar,
> pg_uhc_verifystr, 2},
> + [PG_GB18030] = {0, 0, pg_gb18030_mblen, pg_gb18030_dsplen,
> pg_gb18030_verifychar, pg_gb18030_verifystr, 4},
> + [PG_JOHAB] = {0, 0, pg_johab_mblen, pg_johab_dsplen,
> pg_johab_verifychar, pg_johab_verifystr, 3},
> + [PG_SHIFT_JIS_2004] = {0, 0, pg_sjis_mblen, pg_sjis_dsplen,
> pg_sjis_verifychar, pg_sjis_verifystr, 2},
>  };
> similarly, last entry, no need an extra comma?
> also other places last array entry no need extra comma.

For last entry comma, see [1].

[1] https://www.postgresql.org/message-id/386f8c45-c8ac-4681-8add-e3b0852c1620%40eisentraut.org



В списке pgsql-hackers по дате отправления:

Предыдущее
От: jian he
Дата:
Сообщение: Re: Improve readability by using designated initializers when possible
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Optimize planner memory consumption for huge arrays