mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-07 19:10:31 +01:00
shared: pre-allocate GString with 16 bytes for _nm_utils_enum_to_str_full()
In the next commit, GString will be replaced by NMStrBuf. Then, we will pre-allocate a string buffer with 16 bytes, and measure the performance difference. To have it comparable, adjust the pre-allocation size also with GString.
This commit is contained in:
parent
686b58571b
commit
d5d7b4781e
1 changed files with 1 additions and 1 deletions
|
|
@ -143,7 +143,7 @@ _nm_utils_enum_to_str_full (GType type,
|
|||
return g_strdup (enum_value->value_nick);
|
||||
} else if (G_IS_FLAGS_CLASS (klass)) {
|
||||
GFlagsValue *flags_value;
|
||||
GString *str = g_string_new ("");
|
||||
GString *str = g_string_sized_new (16);
|
||||
unsigned uvalue = (unsigned) value;
|
||||
|
||||
flags_separator = flags_separator ?: " ";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue