зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1308317 - Part 9: Remove nsSupportsArray::Compact. r=froydnj
This removes the scriptable method |Compact| which is unused in our codebase and turns up no references in the plugins repo. MozReview-Commit-ID: 5sJtO5COJpB
This commit is contained in:
Родитель
7fde5ad2f6
Коммит
5b5f49eb80
|
@ -48,9 +48,6 @@ interface nsISupportsArray : nsICollection {
|
|||
// xpcom-compatible versions
|
||||
void DeleteElementAt(in unsigned long aIndex);
|
||||
|
||||
void Compact();
|
||||
|
||||
|
||||
nsISupportsArray clone();
|
||||
};
|
||||
|
||||
|
|
|
@ -307,29 +307,6 @@ nsSupportsArray::Clear(void)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSupportsArray::Compact(void)
|
||||
{
|
||||
if ((mArraySize != mCount) && (kAutoArraySize < mArraySize)) {
|
||||
nsISupports** oldArray = mArray;
|
||||
if (mCount <= kAutoArraySize) {
|
||||
mArray = mAutoArray;
|
||||
mArraySize = kAutoArraySize;
|
||||
} else {
|
||||
mArray = new nsISupports*[mCount];
|
||||
if (!mArray) {
|
||||
mArray = oldArray;
|
||||
return NS_OK;
|
||||
}
|
||||
mArraySize = mCount;
|
||||
}
|
||||
|
||||
::memcpy(mArray, oldArray, mCount * sizeof(nsISupports*));
|
||||
delete[] oldArray;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSupportsArray::Enumerate(nsIEnumerator** aResult)
|
||||
{
|
||||
|
|
|
@ -82,8 +82,6 @@ public:
|
|||
return (RemoveElementAt(aIndex) ? NS_OK : NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
NS_IMETHOD Compact(void) override;
|
||||
|
||||
MOZ_MUST_USE NS_IMETHOD Clone(nsISupportsArray** aResult) override;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -146,10 +146,6 @@ TEST(Array, main)
|
|||
FillArray(array, 4);
|
||||
CheckArray(array, 4, fillResult, 4);
|
||||
|
||||
// test compact
|
||||
array->Compact();
|
||||
CheckArray(array, 4, fillResult, 4);
|
||||
|
||||
// test delete
|
||||
NS_RELEASE(array);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче