src/gui/editors/eventlist/EventView.cpp:676:11: warning: variable 'i' is incremented both in the loop header and in the loop body [-Wfor-loop-analysis]
This causes the event editor to select the wrong event relative to the playback position pointer. I've rewritten and simplified EventView::makeInitialSelection(). Will push at some point in the future.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had a quick look at the new code and the thought struck me that if the
event list is sorted on time and there are more than a few events
in the list, then binary search would be faster than serial search.
I am not sure where the breakeven point is, but it might be as few as 10 events.
Just an idea.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And it's a good idea. It leads to another idea. We could find the event to select while we are creating the m_eventList in the (confusingly named) applyLayout(). While it's still a linear search, it should be better. I will leave some comments in the code in case I have time to do some cleanup. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This causes the event editor to select the wrong event relative to the playback position pointer. I've rewritten and simplified EventView::makeInitialSelection(). Will push at some point in the future.
Fixed in [r16038].
Related
Commit: [r16038]
I had a quick look at the new code and the thought struck me that if the
event list is sorted on time and there are more than a few events
in the list, then binary search would be faster than serial search.
I am not sure where the breakeven point is, but it might be as few as 10 events.
Just an idea.
And it's a good idea. It leads to another idea. We could find the event to select while we are creating the
m_eventListin the (confusingly named)applyLayout(). While it's still a linear search, it should be better. I will leave some comments in the code in case I have time to do some cleanup. Thanks.