From d089e7d30868d6a1527a68702a7191756e5e7d05 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 16 Dec 2013 21:15:42 +0000 Subject: [PATCH] use std max function for signal level meter update instead of if condition --- src/util.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 052f5512..f96e21f2 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -48,16 +48,10 @@ void CStereoSignalLevelMeter::Update ( CVector& vecsAudio ) for ( int i = 0; i < iStereoVecSize; i += 6 ) // 2 * 3 = 6 -> stereo { // left channel - if ( sMaxL < vecsAudio[i] ) - { - sMaxL = vecsAudio[i]; - } + sMaxL = std::max ( sMaxL, vecsAudio[i] ); // right channel - if ( sMaxR < vecsAudio[i + 1] ) - { - sMaxR = vecsAudio[i + 1]; - } + sMaxR = std::max ( sMaxR, vecsAudio[i + 1] ); } dCurLevelL = UpdateCurLevel ( dCurLevelL, sMaxL );