confusingly written code golly

This commit is contained in:
Adam D. Ruppe 2025-08-02 10:04:27 -04:00
parent e5429c0dbf
commit 7ae8dc137f
1 changed files with 4 additions and 3 deletions

7
midi.d
View File

@ -342,17 +342,18 @@ struct FlattenedTrackStream {
if(events.length <= 1)
return false;
bool hasNoteOn = true;
bool hasNoteOn = false;
bool needsChange = false;
foreach(event; events) {
if(hasNoteOn)
if(hasNoteOn) {
if(event.isNoteOff) {
needsChange = true;
break;
}
else if(event.isNoteOn)
} else if(event.isNoteOn) {
hasNoteOn = true;
}
}
if(!needsChange)
return false;