Skip to content

Commit

Permalink
Remove rawBpm.canConvert<mixxx::Bpm> check
Browse files Browse the repository at this point in the history
  • Loading branch information
danferns committed Aug 27, 2024
1 parent ff86da3 commit ba1080e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/library/basetracktablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,16 +755,13 @@ QVariant BaseTrackTableModel::roleValue(
if (rawBpm.isNull()) {
return QVariant();
}
if (rawBpm.canConvert<mixxx::Bpm>()) {
bpm = rawBpm.value<mixxx::Bpm>();
} else {
bool ok;
const auto bpmValue = rawBpm.toDouble(&ok);
VERIFY_OR_DEBUG_ASSERT(ok) {
return QVariant();
}
bpm = mixxx::Bpm(bpmValue);

// reuse ok variable from key
const auto bpmValue = rawBpm.toDouble(&ok);
VERIFY_OR_DEBUG_ASSERT(ok) {
return QVariant();
}
bpm = mixxx::Bpm(bpmValue);

const auto targetKey = KeyUtils::tonicToKey(0, true);
const auto targetBpm = mixxx::Bpm(100);
Expand Down

0 comments on commit ba1080e

Please # to comment.