mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Avoid silent Array allocations
Hello, In AS3, if a function accepts an arbitrary number of arguments, it will create an Array object behind the scene. Math.min / Math.max are famous culprits :)
This commit is contained in:
parent
9a1447b799
commit
94f969c9a3
@ -243,10 +243,10 @@ public class SkeletonSprite extends DisplayObject {
|
||||
continue;
|
||||
for (var ii:int = 0; ii < verticesLength; ii += 2) {
|
||||
var x:Number = worldVertices[ii], y:Number = worldVertices[ii + 1];
|
||||
minX = Math.min(minX, x);
|
||||
minY = Math.min(minY, y);
|
||||
maxX = Math.max(maxX, x);
|
||||
maxY = Math.max(maxY, y);
|
||||
minX = minX < x ? minX : x;
|
||||
minY = minY < y ? minY : y;
|
||||
maxX = maxX > x ? maxX : x;
|
||||
maxY = maxY > y ? maxY : y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user