diff --git a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp index a44ce7d138..3f27cca449 100644 --- a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp +++ b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp @@ -941,9 +941,7 @@ private: } bufferSizes.addIfNotAlreadyThere (preferredSize); - - DefaultElementComparator comparator; - bufferSizes.sort (comparator); + bufferSizes.sort(); } double getSampleRate() const diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 2211fcf859..6eb62dd2b6 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -1053,6 +1053,16 @@ public: } //============================================================================== + /** Sorts the array using a default comparison operation. + If the type of your elements isn't supported by the DefaultElementComparator class + then you may need to use the other version of sort, which takes a custom comparator. + */ + void sort() + { + DefaultElementComparator comparator; + sort (comparator); + } + /** Sorts the elements in the array. This will use a comparator object to sort the elements into order. The object @@ -1081,7 +1091,7 @@ public: */ template void sort (ElementComparator& comparator, - const bool retainOrderOfEquivalentItems = false) const + const bool retainOrderOfEquivalentItems = false) { const ScopedLockType lock (getLock()); (void) comparator; // if you pass in an object with a static compareElements() method, this