From 7f0e4bb82e408090c0366c63a9ff4c0f7c4b0a8e Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 21 Dec 2011 08:53:50 -0500 Subject: [PATCH] Shave a few cycles in string_agg(). Pavel Stehule --- src/backend/utils/adt/varlena.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } -- 2.40.0