Commit Graph

9 Commits

Author SHA1 Message Date
Maxime Coste
22c34b79f6 Move change listener registration to BufferChangeListener_AutoRegister
DynamicSelectionList now just inherit from this class, so that
the registration logic can be shared.
2013-03-31 14:53:32 +02:00
Maxime Coste
e6c635be34 DynamicSelectionList: optimize updating on buffer modification
Now that we know selections are sorted, we can get the set of selections
needing updating in log(n) time using a binary search, for modification
not changing the line count, this makes updating selections run in log(n)
instead of n.
2013-03-18 19:09:07 +01:00
Maxime Coste
5e88b7fe28 move BufferIterator on_{insert,erase} as DynamicSelectionList implementation detail 2013-03-15 14:22:42 +01:00
Maxime Coste
be0c5ddf49 minor performance tweaks 2013-02-27 19:03:33 +01:00
Maxime Coste
edef8e4e98 Remove Set and use unordered_set 2013-01-31 18:58:25 +01:00
Maxime Coste
3404366b65 add more asserts 2013-01-23 14:39:33 +01:00
Maxime Coste
914ede7a82 Add and use a Set template class for recuring small sets 2013-01-11 14:28:13 +01:00
Maxime Coste
1c94064713 DynamicSelectionList: derive from SelectionList
the previous implementation did not preserve invariant
either, so we'd better use less code.
2012-12-13 18:50:27 +01:00
Maxime Coste
cfd7ee049a move selection updating code out of selection, to DynamicSelectionList
this avoids a lot of unnecessary (add|remove)_change_listener as
creating temporary Selections do not call that anymore.

Use can choose between a SelectionList which or a DynamicSelectionList
depending on wethear the buffer will be modified or not during the
selections lifetime.
2012-12-13 18:50:27 +01:00