GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove usage of Array#fill (#20071) · react/react@6f62abb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src
    • ReactFiberLane.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiberLane.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberLane.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,13 @@ export function higherLanePriority(
640640
}
641641

642642
export function createLaneMap<T>(initial: T): LaneMap<T> {
643-
return new Array(TotalLanes).fill(initial);
643+
// Intentionally pushing one by one.
644+
// https://v8.dev/blog/elements-kinds#avoid-creating-holes
645+
const laneMap = [];
646+
for (let i = 0; i < TotalLanes; i++) {
647+
laneMap.push(initial);
648+
}
649+
return laneMap;
644650
}
645651

646652
export function markRootUpdated(

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.