Make NUM_TOCHAR_prepare and NUM_TOCHAR_finish macros declare "len".
authorRobert Haas <rhaas@postgresql.org>
Mon, 2 Dec 2013 15:51:06 +0000 (10:51 -0500)
committerRobert Haas <rhaas@postgresql.org>
Mon, 2 Dec 2013 15:51:06 +0000 (10:51 -0500)
commita8656a3ab02db5b1de0d696dc8cf588efe7c1341
tree47d2bf72c28cb10b941c0ee8b7e5fbb5d903f851
parent9d140f7be2836e3baf6c9dc7989dea69ef693532
Make NUM_TOCHAR_prepare and NUM_TOCHAR_finish macros declare "len".

Remove the variable from the enclosing scopes so that nothing can be
relying on it.  The net result of this refactoring is that we get rid
of a few unnecessary strlen() calls.

Original patch from Greg Jaskiewicz, substantially expanded by me.
src/backend/utils/adt/formatting.c