changeset 10457:45e3aeac428b

8178837: Potential performance drawback due to type mismatch Reviewed-by: kcr
author ckyang
date Fri, 21 Apr 2017 16:41:30 -0700
parents 5fce3b8a6f13
children a8026ed85c2b
files modules/javafx.graphics/src/main/java/javafx/scene/shape/TriangleMesh.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.graphics/src/main/java/javafx/scene/shape/TriangleMesh.java	Fri Apr 21 08:25:13 2017 -0700
+++ b/modules/javafx.graphics/src/main/java/javafx/scene/shape/TriangleMesh.java	Fri Apr 21 16:41:30 2017 -0700
@@ -552,8 +552,9 @@
         if (isDirty() || cachedBounds == null) {
             cachedBounds = new BoxBounds();
             if (validate()) {
-                final double len = points.size();
-                for (int i = 0; i < len; i += getVertexFormat().getPointElementSize()) {
+                final int len = points.size();
+                final int pointElementSize = getVertexFormat().getPointElementSize();
+                for (int i = 0; i < len; i += pointElementSize) {
                     cachedBounds.add(points.get(i), points.get(i + 1), points.get(i + 2));
                 }
             }