fix: prever copied over cloned
This commit is contained in:
+2
-1
@@ -317,7 +317,8 @@ impl AudioVisualizer {
|
|||||||
// sensitivity to avoid bars becoming flattened or
|
// sensitivity to avoid bars becoming flattened or
|
||||||
// clipped
|
// clipped
|
||||||
fn adjust_autosens(autosens: &mut f32, bars: &[f32]) {
|
fn adjust_autosens(autosens: &mut f32, bars: &[f32]) {
|
||||||
let max_val = bars.iter().cloned().fold(0.0f32, f32::max);
|
let max_val = bars.iter().copied().fold(0.0f32, f32::max);
|
||||||
|
|
||||||
if max_val > 8.0 {
|
if max_val > 8.0 {
|
||||||
*autosens *= 0.98;
|
*autosens *= 0.98;
|
||||||
} else if max_val < 3.0 && *autosens < 3.0 {
|
} else if max_val < 3.0 && *autosens < 3.0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user