MCPcopy Index your code
hub / github.com/darkreader/darkreader / push

Function push

src/utils/array.ts:21–23  ·  view source on GitHub ↗
(array: T[], addition: Iterable<T> | ArrayLike<T>)

Source from the content-addressed store, hash-verified

19// NOTE: Pushing items like `arr.push(...items)` is 3x slower in Firefox
20// https://jsben.ch/nr9OF
21export function push<T>(array: T[], addition: Iterable<T> | ArrayLike<T>): void {
22 forEach(addition, (a) => array.push(a));
23}
24
25// NOTE: Using `Array.from()` is 2x (FF) — 5x (Chrome) slower for ArrayLike (not for Iterable)
26// https://jsben.ch/FJ1mO

Callers 4

getInlineStyleElementsFunction · 0.90
watchForStylePositionsFunction · 0.90
formatSitesFixesConfigFunction · 0.90

Calls 1

forEachFunction · 0.85

Tested by

no test coverage detected