From 0a26b1c0389463af62720836bed3aba2fcd6592c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 14 Jan 2023 10:08:42 -0500 Subject: [PATCH] markup: Use g_string_truncate We don't need a private inline helper for this anymore. --- glib/gmarkup.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/glib/gmarkup.c b/glib/gmarkup.c index 30010a278..0c2a9bece 100644 --- a/glib/gmarkup.c +++ b/glib/gmarkup.c @@ -195,13 +195,6 @@ free_list_node (GMarkupParseContext *context, GSList *node) context->spare_list_nodes = g_slist_concat (node, context->spare_list_nodes); } -static inline void -string_blank (GString *string) -{ - string->str[0] = '\0'; - string->len = 0; -} - /** * g_markup_parse_context_new: * @parser: a #GMarkupParser @@ -856,7 +849,7 @@ release_chunk (GMarkupParseContext *context, GString *str) g_string_free (str, TRUE); return; } - string_blank (str); + g_string_truncate (str, 0); node = get_list_node (context, str); context->spare_chunks = g_slist_concat (node, context->spare_chunks); } @@ -889,7 +882,7 @@ static inline void truncate_partial (GMarkupParseContext *context) { if (context->partial_chunk != NULL) - string_blank (context->partial_chunk); + g_string_truncate (context->partial_chunk, 0); } static inline const gchar*