diff options
author | Tom Lane | 2016-03-10 04:29:05 +0000 |
---|---|---|
committer | Tom Lane | 2016-03-10 04:29:05 +0000 |
commit | cc402116ca156babcd3ef941317f462a96277e3a (patch) | |
tree | 083bf516092f2f04dabafc19ca0827b3caee83f9 | |
parent | 1d4a0ab19a7e45aa8b94d7f720d1d9cefb81ec40 (diff) |
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 consequence
performance-wise, but still they're a bad precedent that can confuse
future patch authors.
Noted by Chapman Flack.
-rw-r--r-- | src/backend/foreign/foreign.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/foreign/foreign.c b/src/backend/foreign/foreign.c index 45180c7414..239849bb0b 100644 --- a/src/backend/foreign/foreign.c +++ b/src/backend/foreign/foreign.c @@ -121,14 +121,14 @@ GetForeignServer(Oid serverid) tp, Anum_pg_foreign_server_srvtype, &isnull); - server->servertype = isnull ? NULL : pstrdup(TextDatumGetCString(datum)); + server->servertype = isnull ? NULL : TextDatumGetCString(datum); /* Extract server version */ datum = SysCacheGetAttr(FOREIGNSERVEROID, tp, Anum_pg_foreign_server_srvversion, &isnull); - server->serverversion = isnull ? NULL : pstrdup(TextDatumGetCString(datum)); + server->serverversion = isnull ? NULL : TextDatumGetCString(datum); /* Extract the srvoptions */ datum = SysCacheGetAttr(FOREIGNSERVEROID, |