From: Robert Haas Date: Wed, 21 Dec 2011 13:53:50 +0000 (-0500) Subject: Shave a few cycles in string_agg(). X-Git-Tag: REL9_2_BETA1~666 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f0e4bb82e408090c0366c63a9ff4c0f7c4b0a8e;p=postgresql Shave a few cycles in string_agg(). Pavel Stehule --- diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index f1d582f4b2..95893386aa 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -3621,7 +3621,7 @@ string_agg_finalfn(PG_FUNCTION_ARGS) state = PG_ARGISNULL(0) ? NULL : (StringInfo) PG_GETARG_POINTER(0); if (state != NULL) - PG_RETURN_TEXT_P(cstring_to_text(state->data)); + PG_RETURN_TEXT_P(cstring_to_text_with_len(state->data, state->len)); else PG_RETURN_NULL(); }