pgsql: Simplify pg_enc2gettext_tbl[] with C99-designated initializer sy

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pgsql: Simplify pg_enc2gettext_tbl[] with C99-designated initializer sy
Дата
Msg-id E1rfypC-001W87-RB@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Simplify pg_enc2gettext_tbl[] with C99-designated initializer syntax

This commit switches pg_enc2gettext_tbl[] in encnames.c to use a
C99-designated initializer syntax.

pg_bind_textdomain_codeset() is simplified so as it is possible to do
a direct lookup at the gettext() array with a value of the enum pg_enc
rather than doing a loop through all its elements, as long as the
encoding value provided by GetDatabaseEncoding() is in the correct range
of supported encoding values.  Note that PG_MULE_INTERNAL gains a value
in the array, pointing to NULL.

Author: Jelte Fennema-Nio
Discussion: https://postgr.es/m/CAGECzQT3caUbcCcszNewCCmMbCuyP7XNAm60J3ybd6PN5kH2Dw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/655dc310460c601d434d05339b7fa46ed97675b3

Modified Files
--------------
src/backend/utils/mb/mbutils.c   | 24 +++++------
src/common/encnames.c            | 86 ++++++++++++++++++++--------------------
src/include/mb/pg_wchar.h        | 11 ++---
src/tools/pgindent/typedefs.list |  1 -
4 files changed, 55 insertions(+), 67 deletions(-)


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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: pgsql: Fix BF failure introduced by commit b3f6b14cf4.
Следующее
От: Thomas Munro
Дата:
Сообщение: pgsql: Return ssize_t in fd.c I/O functions.