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:
cvshook%sicking.cc 2006-02-18 05:54:47 +00:00
parent 9d60eac312
commit 1840854dfb

View File

@ -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