mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:07:44 +00:00
LibWeb: Identical sub-expression bug in URLSearchParams::set
Flagged by sonarcloud, we appear to want to make sure the entry.name matches the name we are searching for duplicates of. Link: https://sonarcloud.io/project/issues?fileUuids=AXvdC606QRvsO1F91p5C&id=SerenityOS_serenity&open=AXvdC_NEQRvsO1F91p6j
This commit is contained in:
parent
fc1b9288bc
commit
7852b0fbc3
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ void URLSearchParams::set(const String& name, const String& value)
|
||||||
if (!existing.is_end()) {
|
if (!existing.is_end()) {
|
||||||
existing->value = value;
|
existing->value = value;
|
||||||
m_list.remove_all_matching([&name, &existing](auto& entry) {
|
m_list.remove_all_matching([&name, &existing](auto& entry) {
|
||||||
return &entry != &*existing && name == name;
|
return &entry != &*existing && entry.name == name;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 2. Otherwise, append a new name-value pair whose name is name and value is value, to this’s list.
|
// 2. Otherwise, append a new name-value pair whose name is name and value is value, to this’s list.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue