MCPcopy
hub / github.com/CesiumGS/cesium / addAllToArray

Function addAllToArray

packages/engine/Source/Core/addAllToArray.js:26–39  ·  view source on GitHub ↗

* Adds all elements from the given source array to the given target array. * * If the source is null , undefined , * or empty, then nothing will be done. Otherwise, this has the same * semantics as * for (const s of source) target.push(s); <b

(target, source)

Source from the content-addressed store, hash-verified

24 * // The target is now [ 0, 1, 2, 3, 4, 5 ]
25 */
26function addAllToArray(target, source) {
27 if (!defined(source)) {
28 return;
29 }
30 const sourceLength = source.length;
31 if (sourceLength === 0) {
32 return;
33 }
34 const targetLength = target.length;
35 target.length += sourceLength;
36 for (let i = 0; i < sourceLength; i++) {
37 target[targetLength + i] = source[i];
38 }
39}
40export default addAllToArray;

Callers 15

generateFeatureIdsFunction · 0.90
addAllSpec.jsFile · 0.90
ShaderBuilder.jsFile · 0.85
generateStructLinesFunction · 0.85
generateFunctionLinesFunction · 0.85
PropertyTable.jsFile · 0.85
flattenFunction · 0.85
parseFunction · 0.85

Calls 1

definedFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…