зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1379113 - Deleting non-existing URL query parameters should remove ?, r=qdot
This commit is contained in:
Родитель
3873b52a7c
Коммит
01e80abe92
|
@ -86,20 +86,16 @@ URLParams::Set(const nsAString& aName, const nsAString& aValue)
|
|||
param->mValue = aValue;
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
URLParams::Delete(const nsAString& aName)
|
||||
{
|
||||
bool found = false;
|
||||
for (uint32_t i = 0; i < mParams.Length();) {
|
||||
if (mParams[i].mKey.Equals(aName)) {
|
||||
mParams.RemoveElementAt(i);
|
||||
found = true;
|
||||
} else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -375,9 +371,8 @@ URLSearchParams::Has(const nsAString& aName)
|
|||
void
|
||||
URLSearchParams::Delete(const nsAString& aName)
|
||||
{
|
||||
if (mParams->Delete(aName)) {
|
||||
NotifyObserver();
|
||||
}
|
||||
mParams->Delete(aName);
|
||||
NotifyObserver();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -77,8 +77,7 @@ public:
|
|||
|
||||
bool Has(const nsAString& aName);
|
||||
|
||||
// Returns true if aName was found and deleted, false otherwise.
|
||||
bool Delete(const nsAString& aName);
|
||||
void Delete(const nsAString& aName);
|
||||
|
||||
void DeleteAll()
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче