New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #19480 last tied note accidentals #19482
Conversation
Note* nn = n; | ||
while (nn && nn->tieFor()) { | ||
nn = nn->tieFor()->endNote(); | ||
if (nn) { | ||
score->undo(new ChangePitch(nn, pitch, tpc1, tpc2)); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not:
Note* nn = n; | |
while (nn && nn->tieFor()) { | |
nn = nn->tieFor()->endNote(); | |
if (nn) { | |
score->undo(new ChangePitch(nn, pitch, tpc1, tpc2)); | |
} | |
} | |
for (Note* nn = n; nn; nn = nn->tieFor() ? nn->tieFor()->endNote() : nullptr) { | |
score->undo(new ChangePitch(nn, pitch, tpc1, tpc2)); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not:
I think
- becouse
endNote()
may bynullptr
, so we would need nullcheck anyway - because we dont need to change
n
(which is tie start note), but need to start with next tied note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- becouse
endNote()
may bynullptr
, so we would need nullcheck anyway
That would be done by the ; nn;
.
Anyway, I'll stop nitpicking about things like this :)
Resolves: #19480
Caused by 43df579
Last tied note was excluded by for loop condition
I reverted that change and added other safety check(s)