
12 Feb
2007
12 Feb
'07
5:15 p.m.
On Sunday 11 February 2007 19:15 pm, Timmo Stange wrote:
Frank Mori Hess wrote:
connect() is O(n) anyways, if you do automatic slot cleanup there.
I suppose a binary search would work too, since the list is kept ordered. That would reduce the insertion time when a group is specified to O(log n). Connect for ungrouped slots is already O(1).
You need a container with random access iterators in order for that to have the expected complexity.
Okay, I've optimized the Group/GroupCompare support so it doesn't take linear time to insert a grouped slot anymore. I added a std::map which maintains a list iterator to the first slot in each group. See the grouped_list class in thread_safe_signals/detail/slot_groups.hpp. -- Frank