MCPcopy Create free account
hub / github.com/cocos/cocos-engine / copy

Function copy

cocos/core/utils/array.ts:254–261  ·  view source on GitHub ↗
(array: T[])

Source from the content-addressed store, hash-verified

252 * @returns @zh 数组的副本。@en A new array has the same values as `array`.
253 */
254export function copy<T> (array: T[]): T[] {
255 const len = array.length;
256 const cloned = new Array<T>(len);
257 for (let i = 0; i < len; i += 1) {
258 cloned[i] = array[i];
259 }
260 return cloned;
261}
262
263export function fillItems<T> (array: T[], ...items: T[]): void {
264 for (let i = 0, len = items.length; i < len; ++i) {

Callers 15

operator()Method · 0.50
resetUBOsMethod · 0.50
MaterialInstanceMethod · 0.50
createMatrixMethod · 0.50
copyToValidFrustumMethod · 0.50
pathCompositeFunction · 0.50
_winLogFunction · 0.50
initMethod · 0.50
Frustum.cppFile · 0.50
copyMethod · 0.50
cloneMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected