string: Add a G_LIKELY

This is the case we optimize for.
This commit is contained in:
Matthias Clasen 2023-01-14 09:08:02 -05:00
parent 34b7992fd6
commit 0cc74d5a37

View File

@ -168,7 +168,7 @@ static inline GString*
g_string_append_c_inline (GString *gstring,
gchar c)
{
if (gstring->len + 1 < gstring->allocated_len)
if (G_LIKELY (gstring->len + 1 < gstring->allocated_len))
{
gstring->str[gstring->len++] = c;
gstring->str[gstring->len] = 0;