Re: small cleanup in unicode_norm.c

From: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: small cleanup in unicode_norm.c
Date: 2020-12-08 18:25:43
Message-ID: CAFBsxsEsVh3JuQBqJ+2EAUNRx8VaALMizj5i2GTgQNu6_ukxOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 8, 2020 at 5:45 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Mon, Dec 07, 2020 at 03:24:56PM -0400, John Naylor wrote:
> > We've had get_canonical_class() for a while as a backend-only function.
> > There is some ad-hoc code elsewhere that implements the same logic in a
> > couple places, so it makes sense for all sites to use this function
> > instead, as in the attached.
>
> Thanks John for caring about that. This is a nice simplification, and
> it looks fine to me.
>
> -static uint8
> -get_canonical_class(pg_wchar ch)
> -{
> Two nits here. I would use "code" for the name of the argument for
> consistency with get_code_entry(), and add a description at the top of
> this helper routine (say a simple "get the combining class of given
> code"). Anything else you can think of?

Thanks for taking a look. Sounds good, I've made those adjustments and
wrote a commit message. I took another look and didn't see anything else to
address.

--
John Naylor
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
v2-0001-Simplify-ad-hoc-code-for-getting-a-Unicode-codepo.patch application/octet-stream 3.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-12-08 18:28:39 Re: get_constraint_index() and conindid
Previous Message Andrey Borodin 2020-12-08 17:52:52 Re: MultiXact\SLRU buffers configuration