зеркало из https://github.com/mozilla/pjs.git
Bug 327256: Give nsCOMArray ability to preallocate storage space. r/sr=darin
This commit is contained in:
Родитель
cf5b965f72
Коммит
c2d3c62680
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче