From 2a5014383d375898d365cd48425e050439a4d64f Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 22 Jun 2008 14:07:08 +0200 Subject: [PATCH] No need to copy the parser each time it's allocated. Signed-off-by: Pierre Habouzit --- common/markup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/markup.c b/common/markup.c index 05dcdfcc4..62fed8b7e 100644 --- a/common/markup.c +++ b/common/markup.c @@ -215,8 +215,7 @@ markup_parser_data_delete(markup_parser_data_t **p) bool markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen) { - GMarkupParseContext *mkp_ctx; - GMarkupParser parser = + static GMarkupParser const parser = { /* start_element */ markup_parse_start_element, @@ -229,6 +228,7 @@ markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen) /* error */ NULL }; + GMarkupParseContext *mkp_ctx; GError *error = NULL; if(slen <= 0)