Menu

#1588 src/gui/editors/eventlist/EventView.cpp:676: suspicious if ?

None
closed
None
1
2021-05-06
2020-08-31
dcb
No

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]

Discussion

  • Ted Felix

    Ted Felix - 2020-11-03
    • assigned_to: Ted Felix
     
  • Ted Felix

    Ted Felix - 2020-11-03

    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.

     
  • Ted Felix

    Ted Felix - 2021-01-26
    • status: open --> feedback
     
  • Ted Felix

    Ted Felix - 2021-01-26

    Fixed in [r16038].

     

    Related

    Commit: [r16038]

  • dcb

    dcb - 2021-01-26

    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.

     
    • Ted Felix

      Ted Felix - 2021-01-28

      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.

       
  • Ted Felix

    Ted Felix - 2021-05-06
    • status: feedback --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB