Improve visible children performance

This commit is contained in:
Jernej Habjan 2022-09-08 19:18:45 +02:00
parent 3c97cd9a46
commit 272f61eda2

View file

@ -624,19 +624,7 @@ var CameraManager = new Class({
*/
getVisibleChildren: function (children, camera)
{
var visible = [];
for (var i = 0; i < children.length; i++)
{
var child = children[i];
if (child.willRender(camera))
{
visible.push(child);
}
}
return visible;
return children.filter(function(child) { return child.willRender(camera); });
},
/**