From 0cc74d5a3779767f626f23c504d3ce8cb01606b8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 14 Jan 2023 09:08:02 -0500 Subject: [PATCH] string: Add a G_LIKELY This is the case we optimize for. --- glib/gstring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gstring.h b/glib/gstring.h index 17a7e3c2d..8e4cc5657 100644 --- a/glib/gstring.h +++ b/glib/gstring.h @@ -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;