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

Commitcc40211

Browse files
committed
Remove a couple of useless pstrdup() calls.
There's no point in pstrdup'ing the result of TextDatumGetCString,since that's necessarily already a freshly-palloc'd C string.These particular calls are unlikely to be of any consequenceperformance-wise, but still they're a bad precedent that can confusefuture patch authors.Noted by Chapman Flack.
1 parent1d4a0ab commitcc40211

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/foreign/foreign.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ GetForeignServer(Oid serverid)
121121
tp,
122122
Anum_pg_foreign_server_srvtype,
123123
&isnull);
124-
server->servertype=isnull ?NULL :pstrdup(TextDatumGetCString(datum));
124+
server->servertype=isnull ?NULL :TextDatumGetCString(datum);
125125

126126
/* Extract server version */
127127
datum=SysCacheGetAttr(FOREIGNSERVEROID,
128128
tp,
129129
Anum_pg_foreign_server_srvversion,
130130
&isnull);
131-
server->serverversion=isnull ?NULL :pstrdup(TextDatumGetCString(datum));
131+
server->serverversion=isnull ?NULL :TextDatumGetCString(datum);
132132

133133
/* Extract the srvoptions */
134134
datum=SysCacheGetAttr(FOREIGNSERVEROID,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp