Re: Redundant strlen(query) in get_rel_infos

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Redundant strlen(query) in get_rel_infos
Date: 2023-05-11 04:24:05
Message-ID: ZFxt5a/X7rhx0lKb@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-05-11 04:28:40 Re: benchmark results comparing versions 15.2 and 16
Previous Message Michael Paquier 2023-05-11 04:19:54 Re: [PATCH] Add native windows on arm64 support