Added StringArray::ensureStorageAllocated

This commit is contained in:
Vinnie Falco
2013-07-15 06:01:24 -07:00
parent a1289eb502
commit e1c176ceb7
2 changed files with 14 additions and 0 deletions

View File

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

View File

@@ -385,6 +385,15 @@ 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.