v2-0001-Simplify-format-strings-and-remove-ternaries.patch
application/octet-stream
Filename: v2-0001-Simplify-format-strings-and-remove-ternaries.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v2-0001
Subject: Simplify format strings and remove ternaries
| File | + | − |
|---|---|---|
| src/backend/replication/logical/conflict.c | 14 | 19 |
From 1a0cc4144d126e4e83125e5a3db71290d3aab671 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Fri, 28 Nov 2025 15:56:28 +1100
Subject: [PATCH v2] Simplify format strings and remove ternaries
---
src/backend/replication/logical/conflict.c | 33 +++++++++++++-----------------
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/src/backend/replication/logical/conflict.c b/src/backend/replication/logical/conflict.c
index 1669559..c3076ed 100644
--- a/src/backend/replication/logical/conflict.c
+++ b/src/backend/replication/logical/conflict.c
@@ -381,16 +381,11 @@ build_tuple_value_details(EState *estate, ResultRelInfo *relinfo,
if (desc)
{
if (tuple_value.len > 0)
- {
- appendStringInfoString(&tuple_value, "; ");
- appendStringInfo(&tuple_value, _("existing local row %s"),
+ appendStringInfo(&tuple_value, _("; existing local row %s"),
desc);
- }
else
- {
appendStringInfo(&tuple_value, _("Existing local row %s"),
desc);
- }
}
}
@@ -413,14 +408,9 @@ build_tuple_value_details(EState *estate, ResultRelInfo *relinfo,
if (desc)
{
if (tuple_value.len > 0)
- {
- appendStringInfoString(&tuple_value, "; ");
- appendStringInfo(&tuple_value, _("remote row %s"), desc);
- }
+ appendStringInfo(&tuple_value, _("; remote row %s"), desc);
else
- {
appendStringInfo(&tuple_value, _("Remote row %s"), desc);
- }
}
}
@@ -451,16 +441,21 @@ build_tuple_value_details(EState *estate, ResultRelInfo *relinfo,
{
if (tuple_value.len > 0)
{
- appendStringInfoString(&tuple_value, "; ");
- appendStringInfo(&tuple_value, OidIsValid(replica_index)
- ? _("replica identity %s")
- : _("replica identity full %s"), desc);
+ if (OidIsValid(replica_index))
+ appendStringInfo(&tuple_value,
+ _("; replica identity %s"), desc);
+ else
+ appendStringInfo(&tuple_value,
+ _("; replica identity full %s"), desc);
}
else
{
- appendStringInfo(&tuple_value, OidIsValid(replica_index)
- ? _("Replica identity %s")
- : _("Replica identity full %s"), desc);
+ if (OidIsValid(replica_index))
+ appendStringInfo(&tuple_value,
+ _("Replica identity %s"), desc);
+ else
+ appendStringInfo(&tuple_value,
+ _("Replica identity full %s"), desc);
}
}
}
--
1.8.3.1