1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added method StringArray::ensureStorageAllocated()

This commit is contained in:
jules 2013-07-15 11:08:45 +01:00
parent 219a2b1991
commit 731a9b1d59
2 changed files with 13 additions and 0 deletions

View file

@ -504,6 +504,11 @@ void StringArray::appendNumbersToDuplicates (const bool ignoreCase,
}
}
void StringArray::ensureStorageAllocated (int minNumElements)
{
strings.ensureStorageAllocated (minNumElements);
}
void StringArray::minimiseStorageOverheads()
{
strings.minimiseStorageOverheads();

View file

@ -391,6 +391,14 @@ public:
void sort (bool ignoreCase);
//==============================================================================
/** Increases the array's internal storage to hold a minimum number of elements.
Calling this before adding a large known number of elements means that
the array won't have to keep dynamically resizing itself as the elements
are added, and it'll therefore be more efficient.
*/
void ensureStorageAllocated (int minNumElements);
/** Reduces the amount of storage being used by the array.
Arrays typically allocate slightly more storage than they need, and after