From 6fb4bd578ef30fc65c06b98c32a3278d9c443696 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 19 Feb 2015 15:55:16 -0500 Subject: [PATCH] Don't allocate then discard notes on note off. Silly to make a junk Note just to pass to append_note_off_unlocked, which just uses the fields that are on the MIDIEvent anyway then throws it away. Also explicitly dispatch to append_note_off_unlocked in the caller for note ons with velocity 0 rather than make append_note_on_unlocked deal with it. --- libs/evoral/evoral/Sequence.hpp | 6 +-- libs/evoral/src/Sequence.cpp | 70 +++++++++++++++------------------ 2 files changed, 35 insertions(+), 41 deletions(-) diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index 4e6420fbb1..639a85730c 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -331,11 +331,11 @@ private: bool overlaps_unlocked (const NotePtr& ev, const NotePtr& ignore_this_note) const; bool contains_unlocked (const NotePtr& ev) const; - void append_note_on_unlocked (NotePtr, Evoral::event_id_t); - void append_note_off_unlocked(NotePtr); + void append_note_on_unlocked(const MIDIEvent