Skip to content

Commit e6ccd1c

Browse files
committed
Simplify one use of ScanKey in pg_subscription.c
The section of the code in charge of returning all the relations associated to a subscription only need one ScanKey, but allocated two of them. This code was introduced as a copy-paste from a different area on the same file by 7c4f524, making the result confusing to follow. Author: Peter Smith Reviewed-by: Tom Lane, Julien Rouhaud, Bharath Rupireddy Discussion: https://postgr.es/m/CAHut+PsLKe+rN3FjchoJsd76rx2aMsFTB7CTFxRgUP05p=kcpQ@mail.gmail.com
1 parent ec6e70c commit e6ccd1c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/backend/catalog/pg_subscription.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,19 +461,18 @@ GetSubscriptionRelations(Oid subid)
461461
List *res = NIL;
462462
Relation rel;
463463
HeapTuple tup;
464-
int nkeys = 0;
465-
ScanKeyData skey[2];
464+
ScanKeyData skey[1];
466465
SysScanDesc scan;
467466

468467
rel = table_open(SubscriptionRelRelationId, AccessShareLock);
469468

470-
ScanKeyInit(&skey[nkeys++],
469+
ScanKeyInit(&skey[0],
471470
Anum_pg_subscription_rel_srsubid,
472471
BTEqualStrategyNumber, F_OIDEQ,
473472
ObjectIdGetDatum(subid));
474473

475474
scan = systable_beginscan(rel, InvalidOid, false,
476-
NULL, nkeys, skey);
475+
NULL, 1, skey);
477476

478477
while (HeapTupleIsValid(tup = systable_getnext(scan)))
479478
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy