Format the code in xact_decode

Started by cca5507over 1 year ago4 messages
#1cca5507
cca5507@qq.com
1 attachment(s)

Hello hackers, just as the title says:
1. Remove redundant parentheses.
2. Adjust the position of the break statement.
--
Regards,
ChangAo Chen

Attachments:

0001-Format-the-code-in-xact_decode.patchapplication/octet-stream; charset=ISO-8859-1; name=0001-Format-the-code-in-xact_decode.patchDownload
From 39c414da4bfa4f595b5f23b1a24eb746d910fe3a Mon Sep 17 00:00:00 2001
From: ChangAo Chen <cca5507@qq.com>
Date: Sun, 9 Jun 2024 17:16:56 +0800
Subject: [PATCH] Format the code in xact_decode.

---
 src/backend/replication/logical/decode.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c
index 8ec5adfd90..d687ceee33 100644
--- a/src/backend/replication/logical/decode.c
+++ b/src/backend/replication/logical/decode.c
@@ -301,12 +301,13 @@ xact_decode(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
 					ReorderBufferXidSetCatalogChanges(ctx->reorder, xid,
 													  buf->origptr);
 				}
-				else if ((!ctx->fast_forward))
+				else if (!ctx->fast_forward)
 					ReorderBufferImmediateInvalidation(ctx->reorder,
 													   invals->nmsgs,
 													   invals->msgs);
+
+				break;
 			}
-			break;
 		case XLOG_XACT_PREPARE:
 			{
 				xl_xact_parsed_prepare parsed;
-- 
2.34.1

#2Ashutosh Bapat
ashutosh.bapat.oss@gmail.com
In reply to: cca5507 (#1)
Re: Format the code in xact_decode

Changes make the code in case XLOG_XACT_INVALIDATIONS block syntactically
consistent with the other block. LGTM.

On Sun, Jun 9, 2024 at 6:57 PM cca5507 <cca5507@qq.com> wrote:

Hello hackers, just as the title says:
1. Remove redundant parentheses.
2. Adjust the position of the break statement.
--
Regards,
ChangAo Chen

--
Best Wishes,
Ashutosh Bapat

#3cca5507
cca5507@qq.com
In reply to: Ashutosh Bapat (#2)
Re: Format the code in xact_decode

Thank you for reply! I have new a patch in commitfest:Format the code in xact_decode (postgresql.org)

--
Regards,
ChangAo Chen

#4Michael Paquier
michael@paquier.xyz
In reply to: cca5507 (#3)
Re: Format the code in xact_decode

On Mon, Jun 10, 2024 at 06:03:40PM +0800, cca5507 wrote:

Thank you for reply!

No objections here, either.

I have new a patch in commitfest:Format the code in xact_decode
(postgresql.org)

Thanks for tracking that. For reference:
https://commitfest.postgresql.org/48/5028/
--
Michael