From acf28c6fa7c5a4f040883a1e939bc7e69af140b3 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 17 Oct 2017 15:21:26 +0100 Subject: [PATCH] Removed the explicitness of the Array single-item constructors --- .../codecs/juce_LAMEEncoderAudioFormat.cpp | 2 +- .../codecs/juce_OggVorbisAudioFormat.cpp | 2 +- modules/juce_core/containers/juce_Array.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp index 6c9a2b8805..e8eeb3da9c 100644 --- a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp @@ -173,7 +173,7 @@ Array LAMEEncoderAudioFormat::getPossibleSampleRates() Array LAMEEncoderAudioFormat::getPossibleBitDepths() { - return Array (16); + return { 16 }; } bool LAMEEncoderAudioFormat::canDoStereo() { return true; } diff --git a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp index be0209a222..67b01abae9 100644 --- a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp @@ -439,7 +439,7 @@ Array OggVorbisAudioFormat::getPossibleSampleRates() Array OggVorbisAudioFormat::getPossibleBitDepths() { - return Array (32); + return { 32 }; } bool OggVorbisAudioFormat::canDoStereo() { return true; } diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index fc30e0acb9..7692f739d6 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -106,13 +106,13 @@ public: } /** Initalises an Array of size 1 containing a single element. */ - explicit Array (const ElementType& singleElementToAdd) + Array (const ElementType& singleElementToAdd) { add (singleElementToAdd); } /** Initalises an Array of size 1 containing a single element. */ - explicit Array (ElementType&& singleElementToAdd) + Array (ElementType&& singleElementToAdd) { add (static_cast (singleElementToAdd)); } @@ -121,7 +121,7 @@ public: template Array (const ElementType& firstNewElement, OtherElements... otherElements) { - data.ensureAllocatedSize (1 + (int) sizeof... (otherElements)); + data.setAllocatedSize (1 + (int) sizeof... (otherElements)); addAssumingCapacityIsReady (firstNewElement, otherElements...); } @@ -129,7 +129,7 @@ public: template Array (ElementType&& firstNewElement, OtherElements... otherElements) { - data.ensureAllocatedSize (1 + (int) sizeof... (otherElements)); + data.setAllocatedSize (1 + (int) sizeof... (otherElements)); addAssumingCapacityIsReady (static_cast (firstNewElement), otherElements...); }