зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1308317 - Part 4: Remove nsSupportsArray::Equals. r=froydnj
|Equals| is not scriptable and unused in our codebase. MozReview-Commit-ID: BsbJIuR9fSk
This commit is contained in:
Родитель
5eb6276d7f
Коммит
15057c80cb
|
@ -33,8 +33,6 @@ class nsISupportsArray;
|
|||
[scriptable, uuid(241addc8-3608-4e73-8083-2fd6fa09eba2)]
|
||||
interface nsISupportsArray : nsICollection {
|
||||
|
||||
[notxpcom] boolean Equals([const] in nsISupportsArray other);
|
||||
|
||||
[notxpcom] long IndexOf([const] in nsISupports aPossibleElement);
|
||||
[notxpcom] long IndexOfStartingAt([const] in nsISupports aPossibleElement,
|
||||
in unsigned long aStartIndex);
|
||||
|
|
|
@ -196,35 +196,6 @@ nsSupportsArray::DeleteArray(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP_(bool)
|
||||
nsSupportsArray::Equals(const nsISupportsArray* aOther)
|
||||
{
|
||||
if (aOther) {
|
||||
uint32_t countOther;
|
||||
nsISupportsArray* other = const_cast<nsISupportsArray*>(aOther);
|
||||
nsresult rv = other->Count(&countOther);
|
||||
if (NS_FAILED(rv)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mCount == countOther) {
|
||||
uint32_t index = mCount;
|
||||
nsCOMPtr<nsISupports> otherElem;
|
||||
while (index--) {
|
||||
if (NS_FAILED(other->GetElementAt(index, getter_AddRefs(otherElem)))) {
|
||||
return false;
|
||||
}
|
||||
if (mArray[index] != otherElem) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSupportsArray::GetElementAt(uint32_t aIndex, nsISupports** aOutPtr)
|
||||
{
|
||||
|
|
|
@ -60,8 +60,6 @@ public:
|
|||
NS_IMETHOD Clear(void) override;
|
||||
|
||||
// nsISupportsArray methods:
|
||||
NS_IMETHOD_(bool) Equals(const nsISupportsArray* aOther) override;
|
||||
|
||||
NS_IMETHOD_(int32_t) IndexOf(const nsISupports* aPossibleElement) override;
|
||||
NS_IMETHOD_(int32_t) IndexOfStartingAt(const nsISupports* aPossibleElement,
|
||||
uint32_t aStartIndex = 0) override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче