Skip to content

Commit

Permalink
Remove superfluous calls to qMax and qMin
Browse files Browse the repository at this point in the history
Incorparoate proposals from a code review and remove some superfluous calls to `qMax` and `qMin` when calling `setFrom` and `setTo` because the checks are already done in these methods.
  • Loading branch information
michaelgregorius committed Jan 24, 2024
1 parent 65b9e43 commit 26d7c48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ void AudioFileProcessorWaveView::updateSampleRange()
if (m_sample->sampleSize() > 1)
{
const f_cnt_t marging = (m_sample->endFrame() - m_sample->startFrame()) * 0.1;
setFrom(qMax(0, m_sample->startFrame() - marging));
setTo(qMin<size_t>(m_sample->endFrame() + marging, m_sample->sampleSize()));
setFrom(m_sample->startFrame() - marging);
setTo(m_sample->endFrame() + marging);
}
}

Expand Down

0 comments on commit 26d7c48

Please sign in to comment.