Is it possible to add a command that finds if an element from array1 is in array2? findIf is too slow for my use. arrayIntersect is better but a waste of performance (also, given the fact that it runs unscheduled, it can result in an FPS drop if you're working with large arrays)
So in short, what I want is a command that combines both of these commands and returns an index similar to find.
something like:
array1 findAny array2
which gives the index of the first element from array1 that's in array2. Currently, one would have to use:
array1 find (array2 arrayIntersect array1 select 0)
or
array1 findIf {_x in array2}
both are not optimal.
example:
[1,2,3] findAny [5,3,2]
returns: 1 (i.e. the index of the element 2 from the [1,2,3] array)