
On Sunday 11 February 2007 07: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.
The automatic slot cleanup theoretically only needs to check one slot per connect() in order to avoid the problem we discussed. And it's not used in existing code anyway.
Good points. But, in any case it seems preferable to support groups even with O(n) insertion time than to provide no support at all. It adds no overhead to the ungrouped connect(). -- Frank