collectNote makes copy assignment which should be reference assignment
The function collectNote in rendermidi.cpp contains the following line:
const NoteEvent e = nel[i];
I'd like to change this to the following:
const NoteEvent& e = nel[i];
Thus we e make an explict const ref, not a const copy. There is no need to copy as we won't change the original object.
The effect is less memory allocation and deallocation. It probably won't be measurable, but it's better coding practice.
Comments
See https://github.com/musescore/MuseScore/pull/2754
Better make "fix #119716" part of the commit message, so the issue gets closed automatically once the PR gets merged.
Yes of course. That's part of the process.
Fixed in branch master, commit c515df39dd
fix #119716 removed unnecessary copy on assignment, C++ issue.
Fixed in branch 2.0.4, commit e6f3bea791
fix #119716 removed unnecessary copy on assignment, C++ issue.
Automatically closed -- issue fixed for 2 weeks with no activity.