From 42086bb691cd9e8b2208cbcef03fa76be5932d8f Mon Sep 17 00:00:00 2001 From: saker Date: Tue, 26 Sep 2023 07:49:24 -0400 Subject: [PATCH] Use std::min in Sample::visualize Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com> --- src/core/Sample.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Sample.cpp b/src/core/Sample.cpp index 9d25d28d6..c8ee9251a 100644 --- a/src/core/Sample.cpp +++ b/src/core/Sample.cpp @@ -185,7 +185,7 @@ void Sample::visualize(QPainter& p, const QRect& dr, int fromFrame, int toFrame) // the width, so we will have width points, or nbFrames is // smaller than the width (fpp = 1) and we will have nbFrames // points - const int totalPoints = nbFrames > w ? w : nbFrames; + const int totalPoints = std::min(nbFrames, w); std::vector fEdgeMax(totalPoints); std::vector fEdgeMin(totalPoints); std::vector fRmsMax(totalPoints);