identical expression
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
PR created
Regression
No
Workaround
No
Project
/src/importexport/internal/midiimport/importmidi_simplify.cpp line 44
Code:
ReducedFraction sum(0, 1);
for (const auto& d: durations) {
sum += ReducedFraction(d.second.fraction()) / d.first;
}
return desiredLen == desiredLen; // <-- identical expression
Comments
Same code in 3.x.
I guess (!) is rather should be
return sum == desiredlen;
, but I'm not really sure.That function/method is used in some
Q_ASSERT_X()
.So that code is used only in DEBUG mode, never in any released version of MuseScore
See https://github.com/musescore/MuseScore/pull/7179 (for 3.x)
And https://github.com/musescore/MuseScore/pull/7180 (for master)
BTW: it might be helpful if you'd report all these in one go rather than little by little ;-)
only one more found:
[D:/Data/OpenSource/MuseScore-master/src/libmscore/textbase.cpp line 1983
Code:
if (r->height() == 0) {
r = &_layout[i - i].boundingRect(); // <- - same index
}
Hmm,
r = &_layout[i-i].boundingRect();
is the same asr = &_layout[0].boundingRect();
, but I wonder whether it is actually meant to ber = &_layout[i-1].boundingRect();
and whether that code just works by accident?In 3.x too, but at libmscore/textbase.cpp, line1796
Came in via 10ebbb9080
Edit: no, that commit just moved it from text.cpp to textbase.cpp
weird -- with [i - 1] the index is below zero with i = 0
Yes, guess that would need to get prevented too