purple_conv_chat_cb_find's use of g_utf8_collate

Richard Laager rlaager at wiktel.com
Wed Apr 15 00:59:51 EDT 2009


On Tue, 2009-04-14 at 02:27 -0400, Zachary West wrote:
> purple_conv_chat_cb_find() uses g_utf8_collate() to find
> PurpleConvChatBuddys, but this is a _very, very_ slow function, taking
> up a significant chunk of time when dealing with it.
> 
> Is there any reason for this function to be using g_utf8_collate()
> instead of purple_strequal() and purple_normalize()ing the nicks? It's
> just trying to identify which nicks are equal, does it need to take
> the locale into consideration?

It looks like it's using g_utf8_collate() strictly for comparisons. I
don't see how being "linguistically correct" is useful when you simply
want to compare for equality. I haven't tested it, but from a quick read
of the code, I don't know why purple_strequal() by itself wouldn't be
sufficient.

Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://pidgin.im/pipermail/devel/attachments/20090414/498dd517/attachment.sig>


More information about the Devel mailing list