Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.82k stars 821 forks source link

added small optimization to Polygon 'contains' method #1086

Closed Adolio closed 3 years ago

Adolio commented 3 years ago

Hi @PrimaryFeather!

Adobe Scout reported me that quite a lot of time was spent in the numVertices accessor while using the contains method.

What do you think about this small optimization? It seems to be used in few other similar methods too...

Best, Aurélien

PrimaryFeather commented 3 years ago

That's a great find, Aurélien! This is definitely worth the change – it should have been like that all along. Thanks a lot for the pull request! Merged right away. 😄