]> granicus.if.org Git - postgresql/commit
Attached is a patch that replaces a bunch of places where StringInfos
authorNeil Conway <neilc@samurai.com>
Wed, 1 Mar 2006 06:51:01 +0000 (06:51 +0000)
committerNeil Conway <neilc@samurai.com>
Wed, 1 Mar 2006 06:51:01 +0000 (06:51 +0000)
commit0d9742f99aa0ba6b96d0729dd2cb2634a29d0be9
tree3936c2893718f65ff538c359bd75bdcf14d9725e
parent8e5a10d46c38976e40504456a5978caa53b77b3c
Attached is a patch that replaces a bunch of places where StringInfos
are unnecessarily allocated on the heap rather than the stack. If the
StringInfo doesn't outlive the stack frame in which it is created,
there is no need to allocate it on the heap via makeStringInfo() --
stack allocation is faster.  While it's not a big deal unless the
code is in a critical path, I don't see a reason not to save a few
cycles -- using stack allocation is not less readable.

I also cleaned up a bit of code along the way: moved variable
declarations into a more tightly-enclosing scope where possible,
fixed some pointless copying of strings in dblink, etc.
contrib/dblink/dblink.c
contrib/tablefunc/tablefunc.c
contrib/xml2/xpath.c
src/backend/commands/explain.c
src/backend/utils/adt/varlena.c