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

Added a method RectangleList::ensureStorageAllocated

This commit is contained in:
jules 2014-06-29 18:39:45 +01:00
parent 02460bb95b
commit 0bf57ddf0c
5 changed files with 19 additions and 0 deletions

View file

@ -628,6 +628,17 @@ public:
/** Standard method for iterating the rectangles in the list. */
const RectangleType* end() const noexcept { return rects.end(); }
/** Increases the internal storage to hold a minimum number of rectangles.
Calling this before adding a large number of rectangles means that
the array won't have to keep dynamically resizing itself as the elements
are added, and it'll therefore be more efficient.
@see Array::ensureStorageAllocated
*/
void ensureStorageAllocated (int minNumRectangles)
{
rects.ensureStorageAllocated (minNumRectangles);
}
private:
//==============================================================================
Array<RectangleType> rects;