mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
fix thinko in MidiRegionView::add_to_selection()
The existing code isn't wrong, but inefficient. If the selection is empty, then this is necessarily the first note, and cannot be present in the selection. So, don't search the std::set<> and then insert, just insert.
This commit is contained in:
parent
520ccd8ff2
commit
f6496524a4
1 changed files with 4 additions and 10 deletions
|
|
@ -2445,13 +2445,6 @@ MidiRegionView::remove_from_selection (NoteBase* ev)
|
|||
void
|
||||
MidiRegionView::add_to_selection (NoteBase* ev)
|
||||
{
|
||||
Selection::iterator n = _selection.find (ev);
|
||||
|
||||
if (n != _selection.end()) {
|
||||
/* already selected */
|
||||
return;
|
||||
}
|
||||
|
||||
if (_selection.empty()) {
|
||||
|
||||
/* first note selected in this region, force Editor region
|
||||
|
|
@ -2461,9 +2454,10 @@ MidiRegionView::add_to_selection (NoteBase* ev)
|
|||
trackview.editor().set_selected_midi_region_view (*this);
|
||||
}
|
||||
|
||||
_selection.insert (n, ev);
|
||||
ev->set_selected (true);
|
||||
start_playing_midi_note ((ev)->note());
|
||||
if (_selection.insert (ev).second == true) {
|
||||
ev->set_selected (true);
|
||||
start_playing_midi_note ((ev)->note());
|
||||
}
|
||||
}
|
||||
|
||||
Temporal::Beats
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue