Browse Source

Avoid sorting arrays which contain one or fewer elements

tags/2021-05-28
reuk Tom Poole 8 years ago
parent
commit
bd290d8283
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      modules/juce_core/containers/juce_OwnedArray.h

+ 3
- 1
modules/juce_core/containers/juce_OwnedArray.h View File

@@ -880,7 +880,9 @@ public:
// avoids getting warning messages about the parameter being unused
const ScopedLockType lock (getLock());
sortArray (comparator, data.elements.get(), 0, size() - 1, retainOrderOfEquivalentItems);
if (size() > 1)
sortArray (comparator, data.elements.get(), 0, size() - 1, retainOrderOfEquivalentItems);
}
//==============================================================================


Loading…
Cancel
Save