HomeClusterLabs Projects

Feature: libcrmcommon: New pcmk__g_strcat() function

Description

Feature: libcrmcommon: New pcmk__g_strcat() function

Appends each string in a NULL-terminated list of strings to a
destination buffer using g_string_append(). With -O2, a series of
g_string_append() calls is more efficient than a single
g_string_append_printf() call due to the overhead of formatted output.

So this:

g_string_append_printf(buf, %s=%s, name, value);

becomes this:

pcmk__g_strcat(buf, name, "=", value, NULL);

Ref T152

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Sep 21 2022, 12:46 AM
Parents
rP4185fc2cb97d: Merge pull request #2879 from nrwahl2/nrwahl2-T152
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task