mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Remove usage of Array#fill (#20071)
This commit is contained in:
1 parent
89b610969d
commit
8e5adfbd7e
1 file changed
+7
-1
+7
-1
@@ -640,7 +640,13 @@ export function higherLanePriority(
|
||||
}
|
||||
|
||||
export function createLaneMap<T>(initial: T): LaneMap<T> {
|
||||
return new Array(TotalLanes).fill(initial);
|
||||
// Intentionally pushing one by one.
|
||||
// https://v8.dev/blog/elements-kinds#avoid-creating-holes
|
||||
const laneMap = [];
|
||||
for (let i = 0; i < TotalLanes; i++) {
|
||||
laneMap.push(initial);
|
||||
}
|
||||
return laneMap;
|
||||
}
|
||||
|
||||
export function markRootUpdated(
|
||||
|
||||
Reference in new issue
Block a user