From df14b18c1796c080b6d9d3297fccefcca39fdb14 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 23 Jul 2017 09:46:45 +0100 Subject: [PATCH] cleaned up a method in Array --- modules/juce_core/containers/juce_Array.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 6228ea9c41..4e66a70eaa 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -207,10 +207,10 @@ public: /** Fills the Array with the provided value. */ void fill (const ParameterType& newValue) noexcept { - auto n = size(); + const ScopedLockType lock (getLock()); - for (int i = 0; i < n; ++i) - setUnchecked (i, newValue); + for (auto& e : *this) + e = newValue; } //==============================================================================