[Geany-Devel] Implementing stdlib/glib in Geany

Colomban Wendling lists.ban at xxxxx
Mon Apr 28 18:30:54 UTC 2014


Le 28/04/2014 20:30, Dimitar Zhekov a écrit :
> On Sun, 27 Apr 2014 23:05:46 +0200
> Colomban Wendling <lists.ban at herbesfolles.org> wrote:
> 
>> Le 27/04/2014 22:28, Pavel Roschin a écrit :
>>> I found interesting function in utils.c:
>>>
>>> gboolean utils_str_equal(const gchar *a, const gchar *b)
>>>
>>> - GLib has similar g_strcmp0 function since 2.16
>>
>> Ouch indeed.  I just replaced the loop with a strcmp(), which performs
>> roughly 5.4 times better (on a 64bits Linux) for dummy average strings.
> 
> g_strcmp0() checks for NULL strings, like utils_str_equal().
> strcmp() will give you a segfault on NULL argument(s).

https://github.com/geany/geany/commit/5eb526f9d0385fb62f83425c3ccdc13b3940d17f


More information about the Devel mailing list