Skip to content

gmain: optimize "context->sources" hash table to use as set

Thomas Haller requested to merge th/main-sources-dict-as-set into main

Instead of tracking a (guint,GSource*) tuple in the context->sources dictionary, only track pointers to the source_id.

With this we use the GHashTable as Set (g_hash_table_add()), which is optimized and avoids storing a separate value array.

It's simple enough to do, because there are literally 5 references to context->sources. It's easy to review those usages and reason that the handling is correct.

Merge request reports