Use return value of XLogRecGetBlockTag instead of explicit block ref checks and also use XLogRecHasBlockRef/Image macros instead of explicit checks

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Use return value of XLogRecGetBlockTag instead of explicit block ref checks and also use XLogRecHasBlockRef/Image macros instead of explicit checks
Date: 2022-02-10 04:53:19
Message-ID: CALj2ACX7LtMUkFs0xyuyn3UBwhbXrX+is0ni7asxkG4dxB=3XQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I think we can use the return value of XLogRecGetBlockTag instead of
an explicit check XLogRecHasBlockRef as the XLogRecGetBlockTag would
anyways return false in such a case. Also, in some places the macros
XLogRecHasBlockRef and XLogRecHasBlockImage aren't being used instead
the checks are being performed directly.

Although the above change doesn't add any value or improve any
performance but makes use of the existing code better and removes some
unnecessary/duplicate code. Attaching a small patch.

Thoughts?

Regards,
Bharath Rupireddy.

Attachment Content-Type Size
v1-0001-Use-return-value-of-XLogRecGetBlockTag-instead-of.patch application/octet-stream 3.7 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-02-10 05:17:33 Re: Move replication slot structures/enums/macros to a new header file for better usability by external tools/modules
Previous Message Bharath Rupireddy 2022-02-10 04:21:29 Re: Move replication slot structures/enums/macros to a new header file for better usability by external tools/modules