Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite6ccd1c

Browse files
committed
Simplify one use of ScanKey in pg_subscription.c
The section of the code in charge of returning all the relationsassociated to a subscription only need one ScanKey, but allocated two ofthem. This code was introduced as a copy-paste from a different area onthe same file by7c4f524, making the result confusing to follow.Author: Peter SmithReviewed-by: Tom Lane, Julien Rouhaud, Bharath RupireddyDiscussion:https://postgr.es/m/CAHut+PsLKe+rN3FjchoJsd76rx2aMsFTB7CTFxRgUP05p=kcpQ@mail.gmail.com
1 parentec6e70c commite6ccd1c

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
Relationrel;
463463
HeapTupletup;
464-
intnkeys=0;
465-
ScanKeyDataskey[2];
464+
ScanKeyDataskey[1];
466465
SysScanDescscan;
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)

[8]ページ先頭

©2009-2025 Movatter.jp