MCPcopy Create free account
hub / github.com/galacean/engine / findAndRemove

Method findAndRemove

packages/core/src/utils/SafeLoopArray.ts:45–50  ·  view source on GitHub ↗

* Remove item from array that pass the specified comparison function. * @param filter - The comparison function

(filter: (value: T) => boolean)

Source from the content-addressed store, hash-verified

43 * @param filter - The comparison function
44 */
45 findAndRemove(filter: (value: T) => boolean): void {
46 const array = this._array;
47 for (let i = array.length - 1; i >= 0; i--) {
48 filter(array[i]) && this.removeByIndex(i);
49 }
50 }
51
52 /**
53 * The index of the item.

Callers 8

_onDestroyMethod · 0.80
_onDestroyMethod · 0.80
removeChangedListenerFunction · 0.80
_onSessionExitFunction · 0.80
removeClickedMethod · 0.80
onDestroyMethod · 0.80

Calls 1

removeByIndexMethod · 0.95

Tested by

no test coverage detected