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

Commite59b74a

Browse files
committed
dblink: Small code rearrangement for clarity
suggested by Tom Lane
1 parentafd7987 commite59b74a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎contrib/dblink/dblink.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ Datum
360360
dblink_open(PG_FUNCTION_ARGS)
361361
{
362362
PGresult*res=NULL;
363-
PGconn*conn=NULL;
363+
PGconn*conn;
364364
char*curname=NULL;
365365
char*sql=NULL;
366366
char*conname=NULL;
@@ -408,8 +408,8 @@ dblink_open(PG_FUNCTION_ARGS)
408408

409409
if (!rconn|| !rconn->conn)
410410
dblink_conn_not_avail(conname);
411-
else
412-
conn=rconn->conn;
411+
412+
conn=rconn->conn;
413413

414414
/* If we are not in a transaction, start one */
415415
if (PQtransactionStatus(conn)==PQTRANS_IDLE)
@@ -451,7 +451,7 @@ PG_FUNCTION_INFO_V1(dblink_close);
451451
Datum
452452
dblink_close(PG_FUNCTION_ARGS)
453453
{
454-
PGconn*conn=NULL;
454+
PGconn*conn;
455455
PGresult*res=NULL;
456456
char*curname=NULL;
457457
char*conname=NULL;
@@ -495,8 +495,8 @@ dblink_close(PG_FUNCTION_ARGS)
495495

496496
if (!rconn|| !rconn->conn)
497497
dblink_conn_not_avail(conname);
498-
else
499-
conn=rconn->conn;
498+
499+
conn=rconn->conn;
500500

501501
appendStringInfo(&buf,"CLOSE %s",curname);
502502

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp