Bug 327256: Give nsCOMArray ability to preallocate storage space. r/sr=darin
git-svn-id: svn://10.0.0.236/trunk@190512 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
9d60eac312
commit
1840854dfb
@ -108,6 +108,13 @@ public:
|
||||
return ObjectAt(aIndex);
|
||||
}
|
||||
|
||||
// Ensures there is enough space to store a total of aCapacity objects.
|
||||
// This method never deletes any objects.
|
||||
PRBool SetCapacity(PRUint32 aCapacity) {
|
||||
return aCapacity > 0 ? mArray.SizeTo(NS_STATIC_CAST(PRInt32, aCapacity))
|
||||
: PR_TRUE;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// the actual storage
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user