Re: Redundant strlen(query) in get_rel_infos - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Redundant strlen(query) in get_rel_infos
Date
Msg-id ZFxt5a/X7rhx0lKb@paquier.xyz
Whole thread Raw
In response to Redundant strlen(query) in get_rel_infos  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: Redundant strlen(query) in get_rel_infos
List pgsql-hackers
On Thu, May 11, 2023 at 01:06:42PM +1000, Peter Smith wrote:
> While reviewing another patch to the file info.c, I noticed there seem
> to be some unnecessary calls to strlen(query) in get_rel_infos()
> function.
>
> i.e. The query is explicitly initialized to an empty string
> immediately prior, so why the strlen?

It just looks like this was copied from a surrounding area like
get_db_infos().  Keeping the code as it is is no big deal, either, but
yes we could just remove them and save the two calls.  So ok by me.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [PATCH] Add native windows on arm64 support
Next
From: Michael Paquier
Date:
Subject: Re: benchmark results comparing versions 15.2 and 16