Performance fix in dom_chars_handler: use g_strndup instead of g_strdup

Because the origin string can be extraordinarly long, you get more
benefit from this than you would imagine
This commit is contained in:
Christopher D. Carson 2018-12-23 20:48:02 -06:00 committed by Geert Janssens
parent 1a5c2dd254
commit aaeb639d07

View File

@ -95,7 +95,7 @@ static gboolean dom_chars_handler (
{
if (length > 0)
{
gchar* newtext = g_strdup (text);
gchar* newtext = g_strndup (text,length);
xmlNodeAddContentLen ((xmlNodePtr)parent_data,
checked_char_cast (newtext), length);
g_free (newtext);