Skip to content

Commit 16d84e4

Browse files
committed
more tweaks
1 parent 5e4e2ac commit 16d84e4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/svelte/src/internal/client/render.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
EACH_IS_CONTROLLED,
2727
EACH_INDEX_REACTIVE,
2828
EACH_ITEM_REACTIVE,
29-
EACH_IS_ANIMATED,
3029
PassiveDelegatedEvents,
3130
DelegatedEvents
3231
} from '../../constants.js';
@@ -2244,11 +2243,7 @@ function each(anchor_node, collection, flags, key_fn, render_fn, fallback_fn, re
22442243
? []
22452244
: Array.from(maybe_array);
22462245
if (key_fn !== null) {
2247-
const length = array.length;
2248-
keys = Array(length);
2249-
for (let i = 0; i < length; i++) {
2250-
keys[i] = key_fn(array[i]);
2251-
}
2246+
keys = array.map(key_fn);
22522247
}
22532248
if (fallback_fn !== null) {
22542249
if (array.length === 0) {

0 commit comments

Comments
 (0)