Re: [PATCH] backend: compare word-at-a-time in bcTruelen - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Date
Msg-id BFF0DC24-9074-40F9-80B7-8C6976A1B776@gmail.com
Whole thread Raw
In response to [PATCH] backend: compare word-at-a-time in bcTruelen  (Jeremy Kerr <jk@ozlabs.org>)
Responses Re: [PATCH] backend: compare word-at-a-time in bcTruelen
List pgsql-hackers
On Jun 15, 2009, at 9:04 PM, Jeremy Kerr <jk@ozlabs.org> wrote:

> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
>
> ---
> src/backend/utils/adt/varchar.c |   24 +++++++++++++++++++++---
> 1 file changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/ 
> varchar.c
> index 5f3c658..6889dff 100644
> --- a/src/backend/utils/adt/varchar.c
> +++ b/src/backend/utils/adt/varchar.c
> @@ -624,16 +624,34 @@ varchartypmodout(PG_FUNCTION_ARGS)
> static int
> bcTruelen(BpChar *arg)
> {
> +    const unsigned int spaces = 0x20202020;
> +    const int    wordsize = sizeof(spaces);

This looks very non-portable to me.

...Robert


pgsql-hackers by date:

Previous
From: Jeremy Kerr
Date:
Subject: [PATCH] backend: compare word-at-a-time in bcTruelen
Next
From: Jeremy Kerr
Date:
Subject: Re: [PATCH] backend: compare word-at-a-time in bcTruelen