public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Redundant strlen(query) in get_rel_infos
Date: Thu, 11 May 2023 13:24:05 +0900
Message-ID: <ZFxt5a/[email protected]> (raw)
In-Reply-To: <CAHut+PshfqoGfFz6joYVCdqt9uM-UO2RK+edD6mfFPx3OmUt1g@mail.gmail.com>
References: <CAHut+PshfqoGfFz6joYVCdqt9uM-UO2RK+edD6mfFPx3OmUt1g@mail.gmail.com>

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


Attachments:

  [application/pgp-signature] signature.asc (833B, ../ZFxt5a%[email protected]/2-signature.asc)
  download

view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Redundant strlen(query) in get_rel_infos
  In-Reply-To: <ZFxt5a/[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox