From ecf62977838522f6031245dc0467d828a6199aeb Mon Sep 17 00:00:00 2001 From: Phr00t Date: Mon, 19 May 2014 13:46:35 -0400 Subject: [PATCH] stack to deque --- .../src/main/java/com/jme3/bullet/PhysicsSpace.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java b/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java index 1109a92c6..fb7fe1b31 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java @@ -46,14 +46,13 @@ import com.jme3.math.Transform; import com.jme3.math.Vector3f; import com.jme3.scene.Node; import com.jme3.scene.Spatial; -import com.jme3.util.SafeArrayList; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.Stack; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; @@ -95,7 +94,7 @@ public class PhysicsSpace { private Map physicsJoints = new ConcurrentHashMap(); private Map physicsVehicles = new ConcurrentHashMap(); private ArrayList collisionListeners = new ArrayList(); - private Stack collisionEvents = new Stack(); + private ArrayDeque collisionEvents = new ArrayDeque(); private Map collisionGroupListeners = new ConcurrentHashMap(); private ConcurrentLinkedQueue tickListeners = new ConcurrentLinkedQueue(); private PhysicsCollisionEventFactory eventFactory = new PhysicsCollisionEventFactory(); @@ -365,7 +364,7 @@ public class PhysicsSpace { public void distributeEvents() { //add collision callbacks int clistsize = collisionListeners.size(); - while( collisionEvents.empty() == false ) { + while( collisionEvents.isEmpty() == false ) { PhysicsCollisionEvent physicsCollisionEvent = collisionEvents.pop(); for(int i=0;i