No need to copy the parser each time it's allocated.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
This commit is contained in:
parent
f2fd90655e
commit
2a5014383d
|
@ -215,8 +215,7 @@ markup_parser_data_delete(markup_parser_data_t **p)
|
||||||
bool
|
bool
|
||||||
markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen)
|
markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen)
|
||||||
{
|
{
|
||||||
GMarkupParseContext *mkp_ctx;
|
static GMarkupParser const parser =
|
||||||
GMarkupParser parser =
|
|
||||||
{
|
{
|
||||||
/* start_element */
|
/* start_element */
|
||||||
markup_parse_start_element,
|
markup_parse_start_element,
|
||||||
|
@ -229,6 +228,7 @@ markup_parse(markup_parser_data_t *data, const char *str, ssize_t slen)
|
||||||
/* error */
|
/* error */
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
GMarkupParseContext *mkp_ctx;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if(slen <= 0)
|
if(slen <= 0)
|
||||||
|
|
Loading…
Reference in New Issue