We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2555ceb commit 047b557Copy full SHA for 047b557
packages/svelte/src/reactivity/set.js
@@ -160,17 +160,16 @@ export class ReactiveSet extends Set {
160
}
161
162
entries() {
163
- const values = Array.from(this.values());
164
- let next_index = 0;
+ const iterator = this.values();
165
166
return make_iterable(
167
- /** @type {any} */ ({
+ /** @type {IterableIterator<[T, T]>} */ ({
168
next() {
169
- const index = next_index;
170
- next_index += 1;
171
- return index < values.length
172
- ? { value: [values[index], values[index]], done: false }
173
- : { done: true };
+ for (const value of iterator) {
+ return { value: [value, value], done: false };
+ }
+
+ return { done: true };
174
175
})
176
);
0 commit comments