After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 518160 - replace two g_strdup_printf calls in GBookmarkFile
replace two g_strdup_printf calls in GBookmarkFile
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.15.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-02-22 23:40 UTC by Felix Riemann
Modified: 2008-03-22 17:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
described patch (933 bytes, patch)
2008-02-22 23:41 UTC, Felix Riemann
committed Details | Review

Description Felix Riemann 2008-02-22 23:40:29 UTC
While parsing a file GBookmarkFile calls a function is_element_full. This function merges 4 strings into 2 strings and checks them for equality. The merger is done using two g_strdup_printf calls. The following patch removes the g_strdup_printf calls and simply compares the corresponding string parts.
Comment 1 Felix Riemann 2008-02-22 23:41:35 UTC
Created attachment 105799 [details] [review]
described patch

This patch does as told above. It avoids the costly printf calls.
Comment 2 Emmanuele Bassi (:ebassi) 2008-03-22 17:02:19 UTC
committed to trunk.

2008-03-22  Emmanuele Bassi  <ebassi@gnome.org>

        Bug 518160 - replace two g_strdup_printf calls in GBookmarkFile

        * glib/gbookmarkfile.c (is_element_full): Compare the fragments
        instead of building two strings; this avoids two g_strdup_printf()
        per namespaced element enountered. (#518160, Felix Riemann)