mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
Remove usage of Array#fill (#20071)
This commit is contained in:
parent
89b610969d
commit
8e5adfbd7e
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user