mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
AK: Don't keep equal JsonObject keys in the order vector twice
Fixes #3069.
This commit is contained in:
parent
ecc8a42cd2
commit
f649009887
Notes:
sideshowbarker
2024-07-19 04:04:15 +09:00
Author: https://github.com/linusg
Commit: f649009887
Pull-request: https://github.com/SerenityOS/serenity/pull/3070
Issue: https://github.com/SerenityOS/serenity/issues/3069
Reviewed-by: https://github.com/awesomekling
1 changed files with 2 additions and 1 deletions
|
@ -100,8 +100,9 @@ public:
|
||||||
|
|
||||||
void set(const String& key, JsonValue value)
|
void set(const String& key, JsonValue value)
|
||||||
{
|
{
|
||||||
|
if (m_members.set(key, move(value)) == HashSetResult::ReplacedExistingEntry)
|
||||||
|
m_order.remove(m_order.find_first_index(key).value());
|
||||||
m_order.append(key);
|
m_order.append(key);
|
||||||
m_members.set(key, move(value));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Callback>
|
template<typename Callback>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue