]> granicus.if.org Git - postgresql/commitdiff
Shave a few cycles in string_agg().
authorRobert Haas <rhaas@postgresql.org>
Wed, 21 Dec 2011 13:53:50 +0000 (08:53 -0500)
committerRobert Haas <rhaas@postgresql.org>
Wed, 21 Dec 2011 13:53:50 +0000 (08:53 -0500)
Pavel Stehule

src/backend/utils/adt/varlena.c

index f1d582f4b24977fa31ea193d7073135073b472d8..95893386aae6ef4f06afbef3a2082dbd558dc254 100644 (file)
@@ -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();
 }