aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2012-01-16 14:09:13 -0800
committerHarvey Harrison <harvey.harrison@gmail.com>2012-01-16 14:30:32 -0800
commit687ca5f02d22fa489cf0e7dd4dd3c5e9fcfa7b19 (patch)
tree098b8467ce151c3d642f1b2da18b11e1299a0ca6 /src
parent340456818fc9514428639bb154254af57e23cda4 (diff)
j3dcore: remove temporary Point3d from BoundingBox
Rely on escape analysis in the VM here, this method could be coded more carefully anyway to avoid most of the floating point math. On 64-bit reduces BoundingBox from 70->62 bytes Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/BoundingBox.java10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/classes/share/javax/media/j3d/BoundingBox.java b/src/classes/share/javax/media/j3d/BoundingBox.java
index 817b831..6a41dbd 100644
--- a/src/classes/share/javax/media/j3d/BoundingBox.java
+++ b/src/classes/share/javax/media/j3d/BoundingBox.java
@@ -62,7 +62,6 @@ final Point3d upper;
// reusable temp objects
private BoundingSphere tmpSphere = null;
private BoundingPolytope tmpPolytope = null;
- private Point3d tmpP3d = null;
// Issue 561: Set by -Dj3d.releaseBoundingBoxMemory property.
// When set to true, the per-instance fields used in bounding box
@@ -699,9 +698,7 @@ public void setUpper(Point3d p1) {
if (boundsIsInfinite)
return;
- if (tmpP3d == null) {
- tmpP3d = new Point3d();
- }
+ Point3d tmpP3d = new Point3d();
double ux, uy, uz, lx, ly, lz;
ux = upper.x; uy = upper.y; uz = upper.z;
@@ -779,11 +776,6 @@ public void setUpper(Point3d p1) {
if ( tmpP3d.y < lower.y ) lower.y = tmpP3d.y;
if ( tmpP3d.z < lower.z ) lower.z = tmpP3d.z;
- if (releaseBoundingBoxMemory) {
- // Free memory
- tmpP3d = null;
- }
-
}
/**