From ba1080e5cacf847026721184548027588ca68602 Mon Sep 17 00:00:00 2001 From: danferns Date: Tue, 27 Aug 2024 19:22:40 +0530 Subject: [PATCH] Remove rawBpm.canConvert check --- src/library/basetracktablemodel.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/library/basetracktablemodel.cpp b/src/library/basetracktablemodel.cpp index 2d95398af2e1..89e40ba43606 100644 --- a/src/library/basetracktablemodel.cpp +++ b/src/library/basetracktablemodel.cpp @@ -755,16 +755,13 @@ QVariant BaseTrackTableModel::roleValue( if (rawBpm.isNull()) { return QVariant(); } - if (rawBpm.canConvert()) { - bpm = rawBpm.value(); - } 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);