mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
LibJS/Bytecode: Remove redundant property uniqueness check
This invariant is enforced by virtue of `items` being a HashTable.
This commit is contained in:
parent
d0dce5c60f
commit
b39d8af5a6
1 changed files with 1 additions and 6 deletions
|
@ -1189,7 +1189,7 @@ ThrowCompletionOr<void> GetObjectPropertyIterator::execute_impl(Bytecode::Interp
|
||||||
.iterator = object,
|
.iterator = object,
|
||||||
.next_method = NativeFunction::create(
|
.next_method = NativeFunction::create(
|
||||||
interpreter.realm(),
|
interpreter.realm(),
|
||||||
[seen_items = HashTable<PropertyKey>(), items = move(properties)](VM& vm) mutable -> ThrowCompletionOr<Value> {
|
[items = move(properties)](VM& vm) mutable -> ThrowCompletionOr<Value> {
|
||||||
auto& realm = *vm.current_realm();
|
auto& realm = *vm.current_realm();
|
||||||
auto iterated_object_value = vm.this_value();
|
auto iterated_object_value = vm.this_value();
|
||||||
if (!iterated_object_value.is_object())
|
if (!iterated_object_value.is_object())
|
||||||
|
@ -1205,11 +1205,6 @@ ThrowCompletionOr<void> GetObjectPropertyIterator::execute_impl(Bytecode::Interp
|
||||||
|
|
||||||
auto key = items.take_first();
|
auto key = items.take_first();
|
||||||
|
|
||||||
// If the key was already seen, skip over it (invariant no. 4)
|
|
||||||
auto result = seen_items.set(key);
|
|
||||||
if (result != AK::HashSetResult::InsertedNewEntry)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// If the property is deleted, don't include it (invariant no. 2)
|
// If the property is deleted, don't include it (invariant no. 2)
|
||||||
if (!TRY(iterated_object.has_property(key)))
|
if (!TRY(iterated_object.has_property(key)))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue