Heads up: potential hash table ordering changes in GLib



Hi all,

As a heads up, we’ve just merged some performance improvements to
GHashTable, done by Hans Petter Jansson:

https://gitlab.gnome.org/GNOME/glib/merge_requests/208
https://gitlab.gnome.org/GNOME/glib/issues/1198
https://hpjansson.org/blag/2018/08/29/what-ails-ghashtable/
https://hpjansson.org/blag/2018/07/24/a-hash-table-re-hash/

These may change the hash table iteration order. If you are using
GHashTable incorrectly by relying on it to iterate over its entries in
a particular order, this may break your code.

You should fix this by either making your code independent of order, or
sorting the entries once you’ve extracted them from the GHashTable (and
before your order-dependent iteration over them).

This is not a bug in GLib.

To the best of my knowledge, we last changed iteration order in 2008,
so some code written since then may break.

Have fun,
Philip

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]