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
Notes:
sideshowbarker
2024-07-18 04:02:18 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/7852b0fbc3f Pull-request: https://github.com/SerenityOS/serenity/pull/10013 Reviewed-by: https://github.com/IdanHo ✅ Reviewed-by: https://github.com/linusg
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()) {
|
||||
existing->value = value;
|
||||
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.
|
||||
|
|
Loading…
Add table
Reference in a new issue