Browse Source

Removed the explicitness of the Array single-item constructors

tags/2021-05-28
jules 7 years ago
parent
commit
acf28c6fa7
3 changed files with 6 additions and 6 deletions
  1. +1
    -1
      modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp
  2. +1
    -1
      modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp
  3. +4
    -4
      modules/juce_core/containers/juce_Array.h

+ 1
- 1
modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp View File

@@ -173,7 +173,7 @@ Array<int> LAMEEncoderAudioFormat::getPossibleSampleRates()
Array<int> LAMEEncoderAudioFormat::getPossibleBitDepths() Array<int> LAMEEncoderAudioFormat::getPossibleBitDepths()
{ {
return Array<int> (16);
return { 16 };
} }
bool LAMEEncoderAudioFormat::canDoStereo() { return true; } bool LAMEEncoderAudioFormat::canDoStereo() { return true; }


+ 1
- 1
modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp View File

@@ -439,7 +439,7 @@ Array<int> OggVorbisAudioFormat::getPossibleSampleRates()
Array<int> OggVorbisAudioFormat::getPossibleBitDepths() Array<int> OggVorbisAudioFormat::getPossibleBitDepths()
{ {
return Array<int> (32);
return { 32 };
} }
bool OggVorbisAudioFormat::canDoStereo() { return true; } bool OggVorbisAudioFormat::canDoStereo() { return true; }


+ 4
- 4
modules/juce_core/containers/juce_Array.h View File

@@ -106,13 +106,13 @@ public:
} }
/** Initalises an Array of size 1 containing a single element. */ /** Initalises an Array of size 1 containing a single element. */
explicit Array (const ElementType& singleElementToAdd)
Array (const ElementType& singleElementToAdd)
{ {
add (singleElementToAdd); add (singleElementToAdd);
} }
/** Initalises an Array of size 1 containing a single element. */ /** Initalises an Array of size 1 containing a single element. */
explicit Array (ElementType&& singleElementToAdd)
Array (ElementType&& singleElementToAdd)
{ {
add (static_cast<ElementType&&> (singleElementToAdd)); add (static_cast<ElementType&&> (singleElementToAdd));
} }
@@ -121,7 +121,7 @@ public:
template <typename... OtherElements> template <typename... OtherElements>
Array (const ElementType& firstNewElement, OtherElements... otherElements) Array (const ElementType& firstNewElement, OtherElements... otherElements)
{ {
data.ensureAllocatedSize (1 + (int) sizeof... (otherElements));
data.setAllocatedSize (1 + (int) sizeof... (otherElements));
addAssumingCapacityIsReady (firstNewElement, otherElements...); addAssumingCapacityIsReady (firstNewElement, otherElements...);
} }
@@ -129,7 +129,7 @@ public:
template <typename... OtherElements> template <typename... OtherElements>
Array (ElementType&& firstNewElement, OtherElements... otherElements) Array (ElementType&& firstNewElement, OtherElements... otherElements)
{ {
data.ensureAllocatedSize (1 + (int) sizeof... (otherElements));
data.setAllocatedSize (1 + (int) sizeof... (otherElements));
addAssumingCapacityIsReady (static_cast<ElementType&&> (firstNewElement), otherElements...); addAssumingCapacityIsReady (static_cast<ElementType&&> (firstNewElement), otherElements...);
} }


Loading…
Cancel
Save