Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
Duplicate of musescore#8866, part 2
  • Loading branch information
RomanPudashkin authored and Jojo-Schmitz committed Aug 18, 2021
1 parent f6cccc8 commit 75b220a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libmscore/instrtemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,9 @@ InstrumentTemplate* searchTemplateForInstrNameList(const QList<QString>& nameLis

InstrumentTemplate* searchTemplateForMidiProgram(int midiProgram, const bool useDrumSet)
{
if (midiProgram < 0)
return nullptr;

for (InstrumentGroup* g : qAsConst(instrumentGroups)) {
for (InstrumentTemplate* it : qAsConst(g->instrumentTemplates)) {
if (it->channel.empty() || it->useDrumset != useDrumSet)
Expand Down

0 comments on commit 75b220a

Please sign in to comment.