diff options
author | Harvey Harrison <[email protected]> | 2012-10-09 22:53:36 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2012-10-09 22:53:36 -0700 |
commit | 6a5881bac90e9423712c8c708e875b2f9e94bc74 (patch) | |
tree | 436557657c22773a674b379b40c6832711c07d6f | |
parent | f2b9c5d4d02dbf2ca61aaa886c34d3238863d000 (diff) |
j3dcore: push some local variables down into the loops they are used in
Signed-off-by: Harvey Harrison <[email protected]>
-rw-r--r-- | src/classes/share/javax/media/j3d/Shape3DCompileRetained.java | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/classes/share/javax/media/j3d/Shape3DCompileRetained.java b/src/classes/share/javax/media/j3d/Shape3DCompileRetained.java index d1d615d..56c1fea 100644 --- a/src/classes/share/javax/media/j3d/Shape3DCompileRetained.java +++ b/src/classes/share/javax/media/j3d/Shape3DCompileRetained.java @@ -48,8 +48,6 @@ ArrayList<ArrayList<Geometry>> geometryInfo = null; Shape3DCompileRetained(Shape3DRetained[] shapes, int nShapes, int compileFlags) { int i, j; - Shape3DRetained shape; - GeometryArrayRetained geo; // Merged list, only merged if geometry is mergeable ArrayList<GeometryArrayRetained>[] mergedList = new ArrayList[GeometryRetained.GEO_TYPE_GEOMETRYARRAY + 1]; // Sorted list of separate geometry by geoType @@ -85,7 +83,7 @@ ArrayList<ArrayList<Geometry>> geometryInfo = null; geometryInfo = new ArrayList<ArrayList<Geometry>>(); for (i = 0; i < nShapes; i++) { - shape = shapes[i]; + Shape3DRetained shape = shapes[i]; ((Shape3D)shape.source).id = i; shape.source.retained = this; srcList[i] = shape.source; @@ -95,27 +93,27 @@ ArrayList<ArrayList<Geometry>> geometryInfo = null; // Put it in a separate list sorted by geo_type // Have to handle shape.isPickable - for (j = 0; j < shape.geometryList.size(); j++) { - geo = (GeometryArrayRetained)shape.geometryList.get(j); - if (geo != null) { - if (shape.willRemainOpaque(geo.geoType) && geo.isMergeable()) { - if (mergedList[geo.geoType] == null) { - mergedList[geo.geoType] = new ArrayList<GeometryArrayRetained>(); + for (j = 0; j < shape.geometryList.size(); j++) { + GeometryArrayRetained geo = (GeometryArrayRetained)shape.geometryList.get(j); + if (geo == null) + continue; + + if (shape.willRemainOpaque(geo.geoType) && geo.isMergeable()) { + if (mergedList[geo.geoType] == null) { + mergedList[geo.geoType] = new ArrayList<GeometryArrayRetained>(); + } + mergedList[geo.geoType].add(geo); } - mergedList[geo.geoType].add(geo); - } - else { - // Keep a sorted list based on geoType; - if (separateList[geo.geoType] == null) { - separateList[geo.geoType] = new ArrayList<GeometryArrayRetained>(); + else { + // Keep a sorted list based on geoType; + if (separateList[geo.geoType] == null) { + separateList[geo.geoType] = new ArrayList<GeometryArrayRetained>(); + } + // add it to the geometryList separately + separateList[geo.geoType].add(geo); } - // add it to the geometryList separately - separateList[geo.geoType].add(geo); - } } - } - // Point to the geometryList's source, so the // retained side will be garbage collected if ((compileFlags & CompileState.GEOMETRY_READ) != 0) { |