Skip to content

Commit

Permalink
Code review adjustments
Browse files Browse the repository at this point in the history
Decrease code repetition even more by applying Veratil's suggestion from a code review.
  • Loading branch information
michaelgregorius committed Mar 11, 2024
1 parent 6da8fd4 commit bb14d25
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/gui/widgets/FloatModelEditorBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,11 @@ QString FloatModelEditorBase::displayValue() const
ConfigManager::inst()->value("app", "displaydbfs").toInt())
{
auto const valueToVolumeRatio = model()->getRoundedValue() / volumeRatio();
if (valueToVolumeRatio == 0.)
{
return m_description.trimmed() + QString(" -∞ dBFS");
}
else
{
return m_description.trimmed() + QString(" %1 dBFS").
arg(ampToDbfs(valueToVolumeRatio), 3, 'f', 2);
}
return m_description.trimmed() + (
valueToVolumeRatio == 0.
? QString(" -∞ dBFS")
: QString(" %1 dBFS").arg(ampToDbfs(valueToVolumeRatio), 3, 'f', 2)
);
}

return m_description.trimmed() + QString(" %1").
Expand Down

0 comments on commit bb14d25

Please sign in to comment.