Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vDJs9-006s95-UM for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Oct 2025 09:50:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vDJs7-0079gs-MK for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Oct 2025 09:50:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vDJs7-0079gk-Cl for pgsql-hackers@lists.postgresql.org; Mon, 27 Oct 2025 09:50:38 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vDJs3-004T0F-20 for pgsql-hackers@lists.postgresql.org; Mon, 27 Oct 2025 09:50:37 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-63c3d7e2217so8485164a12.3 for ; Mon, 27 Oct 2025 02:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761558634; x=1762163434; darn=lists.postgresql.org; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=b19OLVWGi+HTIhpYEZgWvF6WLZEq4czuEEOpLa0fqBM=; b=U7n/S3zhWBNI6K0/ZX7jAKy9CVt7Rw6BnAC9457SitObq8MEKMk9QBERG8Xcyv9P86 gjLAQ1xudfBjVp4yFr13tAbygvi14oroWng9JaX3O5A+Ze1p6sxqPaA5U0Imcw186ZcT bq2ohGS6RexLclA+cNHdvSgoBK4/tDXOl4ZY/JF4YlSdv/q6p2Fm2c1N52x2VuxG1vxZ PllFuYWIZqv0oPPDgRtfr1Kb0b2WYWP6rJljwnAHhydR+PsGgHCSXI1IgiGdaF8WhYTO wAVZMJyh4alVyZUlgPBnNTIQwLBBnc9xydvBBY42tecimfimnNk0ALe+8cf0/9vheOgg yloQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761558634; x=1762163434; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b19OLVWGi+HTIhpYEZgWvF6WLZEq4czuEEOpLa0fqBM=; b=oQSGCG41L6OFvi4RJ7xY9l5FanJiGMThb2YN4Apanh9i2sax6ioycPGzZFmI+DiG+3 MGGLH2KbI84J0RQY8AAIUE6IsQu50xmVn6/eQWqvmrbrETKZqqRhb/O16UWGDDxnjA5x wS+w4D438mIRBgc7AuU3s2bBQESpbVFL5LoFI+gvo1btWXK691hnoZmwo8J4SC8A+OY1 k8lMGFMaGZpdOiRfNLOjzMpoHJ0DMiRnMZywc/a4K6KJn/9dBIkhAz3yUCQG5Pg1qRXf Vme3x61pfaszBwnC+e+DsrtF8xQkmWH2CSg+hbIkdoDU/FSrLF0utw9ci7lZKe6+ZYaN QdsA== X-Forwarded-Encrypted: i=1; AJvYcCXeDmuKijJp++xPwRJwuPQ59FjCg7q+/QnTmxff310/IXe5B5g/1xv9szBRRFQsmZP5dE3iQYXF0oD8FFzb@lists.postgresql.org X-Gm-Message-State: AOJu0YxOPmZ/PeiAVlzNSpvzBTjaywU0+oQMRgW+iOgsOAMy9DkN16R8 YgM8e9gMvdIdcYxPGWrNG6wgRCyAeLfR4FZ2JwtLSLN4WZASr1mVoCFBFiFbfLg+DeDZSXfFItC eVEdztzbhcEzBMbi7nMHX1yVNclGb+nY= X-Gm-Gg: ASbGncsVAZ99UEZkfMiFswCi7uY78kaa0EsJ5TDvCVf/PFxo4zZg5QF5XcurMcwNh3o a/iDjFLM7cxkiiceiVOLcgMm77ec/yAc745T+GeHymAg/HQFFQvnc/co/VwqeImVCR5W+7BtIfA kwk0+vAT6rSH0GuljXsFwOzVkOi0ZYx1U90MuQX0rPk1132NVI18tNew9IVF1iWTFOUFPM14cv5 CRUBbcp6yYaM0bRee09ClWIxZef18xuoVQTkuUWaRV1f80uImQAf0lxvHHPVuPwwoI/SA== X-Received: by 2002:a05:6402:3581:b0:63c:4f2:2131 with SMTP id 4fb4d7f45d1cf-63e600d16e0mt9041982a12.22.1761558633940; Mon, 27 Oct 2025 02:50:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: wenhui qiu Date: Mon, 27 Oct 2025 17:50:21 +0800 X-Gm-Features: AWmQ_bnig2LloK6oO5B8mZAJ93c8JAz2ZK0vC4XtSSjokhsxI4XHPLiVf3KRqJM Message-ID: Subject: Re: [PATCH] Little refactoring of portalcmds.c Cc: Aleksander Alekseev , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="000000000000a1c0de064220d481" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a1c0de064220d481 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Aleksander Alekseev > The proposed patch places some repetitive code in a helper function. > The value of this change is arguably not that high but it makes the > code a bit neater IMO. I agree with your suggestion to refactor the duplicated code into a function. Thanks On Mon, Oct 27, 2025 at 2:03=E2=80=AFPM Quan Zongliang wrote: > > > On 10/8/25 10:02 PM, Aleksander Alekseev wrote: > > Hi, > > > > The proposed patch places some repetitive code in a helper function. > > The value of this change is arguably not that high but it makes the > > code a bit neater IMO. > > > > It also reduces the ease of reading the code. > Just add a function for a single if statement. I don't think it's > necessary. > > Regards, > Quan Zongliang > > > > --000000000000a1c0de064220d481 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Aleksander Alekseev
>= The proposed patch places some repetitive code in a helper function.
&g= t; The value of this change is arguably not that high but it makes the
&= gt; code a bit neater IMO.=C2=A0
I =C2=A0agree with your sugg= estion to refactor the duplicated code into a function.

Thanks=C2=A0

On Mon, Oct 27, 2025 at 2:03=E2=80=AFPM Quan Zongli= ang <quanzon= gliang@yeah.net> wrote:


On 10/8/25 10:02 PM, Aleksander Alekseev wrote:
> Hi,
>
> The proposed patch places some repetitive code in a helper function. > The value of this change is arguably not that high but it makes the > code a bit neater IMO.
>

It also reduces the ease of reading the code.
Just add a function for a single if statement. I don't think it's n= ecessary.

Regards,
Quan Zongliang



--000000000000a1c0de064220d481--