fe5da079: Patch from Paul Aurich to add purple_str...

Mark Doliner mark at
Wed Jan 7 02:20:31 EST 2009

On Tue, Jan 6, 2009 at 3:06 PM, Richard Laager <rlaager at> wrote:
> On Mon, 2009-01-05 at 23:12 -0800, Mark Doliner wrote:
>> I'd prefer if we used g_str_equal() in places where we know the
>> strings are non-NULL and only use purple_strequal() in places where we
>> would otherwise need to check for NULL.
> Why? Do you believe this will perform better? How much?

Eh, I mean, it WOULD perform a little better, but it's probably
negligible.  I just like for things to be as minimal as possible.  If
g_str_equal() is used and it doesn't crash, then a future developer
can infer that the strings are never NULL, which could be convenient.
I think this slightly valuable as it removes a small amount of guess
work when code needs to be changed down the road.

> I wish that g_str_equal() checked for NULLs, but if that's not the case,
> it seems we'll have to do it ourselves.

I believe g_str_equal() does not check for NULLs, which is the reason
for purple_strequal().


More information about the Devel mailing list