mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibJS: Use HashTable::take_first in GetObjectPropertyIterator
This is a bit more idiomatic than ```c++ auto it = table.begin(); auto k = *it; table.remove(it); ``` and also saves us from copying the stored value.
This commit is contained in:
parent
fd8c54d720
commit
1c8adac442
1 changed files with 1 additions and 3 deletions
|
@ -939,9 +939,7 @@ ThrowCompletionOr<void> GetObjectPropertyIterator::execute_impl(Bytecode::Interp
|
|||
return result_object;
|
||||
}
|
||||
|
||||
auto it = items.begin();
|
||||
auto key = *it;
|
||||
items.remove(it);
|
||||
auto key = items.take_first();
|
||||
|
||||
// If the key was already seen, skip over it (invariant no. 4)
|
||||
auto result = seen_items.set(key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue