message: Switch to using binary search for finding highlighted events
diff: @@ -1544,7 +1544,6 @@ void TraceWin::render_events_list( CIniFile &inifile )
  // Loop through and draw events
  for ( uint32_t i = start_idx; i < end_idx; i++ )
  {
  - bool highlight = false;
  trace_event_t &event = filtered_events ?
  m_trace_events->m_events[ m_filtered_events[ i ] ] :
  m_trace_events->m_events[ i ];
  @@ -1561,25 +1560,23 @@ void TraceWin::render_events_list( CIniFile &inifile )
  ImGui::PushStyleColor( ImGuiCol_Text, col );
  }
  - if ( !selected )
  - {
  // If this event is in the highlighted list, give it a bit of a colored background
  - auto idx = std::lower_bound( m_highlight_ids.begin(), m_highlight_ids.end(), event.id );
  -
  - highlight = ( idx != m_highlight_ids.end() ) &&
  - ( event.id == m_highlight_ids[ idx - m_highlight_ids.begin() ] );
  + bool highlight = !selected && std::binary_search(
  + m_highlight_ids.begin(), m_highlight_ids.end(), event.id );
  if ( highlight )
  {
  const ImVec4 &col = ImGui::GetColorVec4( ImGuiCol_PlotLinesHovered );
  ImGui::PushStyleColor( ImGuiCol_Header, ImVec4( col.x, col.y, col.z, 0.4f ) );
  }
  - }
  // column 0: event id
  {
  - if ( ImGui::Selectable( std::to_string( event.id ).c_str(), highlight || selected, ImGuiSelectableFlags_SpanAllColumns ) )
  + if ( ImGui::Selectable( std::to_string( event.id ).c_str(),
  + highlight || selected, ImGuiSelectableFlags_SpanAllColumns ) )
  + {
  m_selected_eventid = event.id;
  + }
  // Columns bug workaround: selectable with SpanAllColumns & overlaid button does not work.
  // https://github.com/ocornut/imgui/issues/684
  @@ -1651,7 +1648,6 @@ void TraceWin::render_events_list( CIniFile &inifile )
  }
  ImGui::PopStyleColor( event.is_vblank() + highlight );
  -
  ImGui::PopID();
  }
  