Improve performance by iterating from the tail when removing notes.

This commit is contained in:
Francois Best 2014-05-21 09:56:06 +02:00
parent 9157f847ca
commit db002130c9
1 changed files with 3 additions and 3 deletions

View File

@ -197,9 +197,9 @@ inline void MidiNoteList<Size>::add(const MidiNote& inNote)
template<byte Size>
inline void MidiNoteList<Size>::remove(byte inPitch)
{
if (mHead != 0)
if (mTail != 0)
{
for (Cell* it = mHead; it != 0; it = it->next)
for (Cell* it = mTail; it != 0; it = it->prev)
{
if (it->note.pitch == inPitch)
{