removed WorldClient#pairPool
1 files changed, 3 insertions(+), 12 deletions(-)

M src/main/net/dermetfan/kryonet/box2d/multiplayer/WorldClient.java
M src/main/net/dermetfan/kryonet/box2d/multiplayer/WorldClient.java +3 -12
@@ 20,7 20,6 @@ import com.badlogic.gdx.physics.box2d.Jo
 import com.badlogic.gdx.physics.box2d.World;
 import com.badlogic.gdx.utils.IntSet;
 import com.badlogic.gdx.utils.ObjectSet;
-import com.badlogic.gdx.utils.Pool;
 import com.badlogic.gdx.utils.PooledLinkedList;
 import com.badlogic.gdx.utils.Pools;
 import com.badlogic.gdx.utils.reflect.ClassReflection;

          
@@ 124,14 123,6 @@ public class WorldClient extends Listene
 	/** pending {@link UpdateRequest} of a certain type */
 	private final IntSet pendingCreationRequests = new IntSet(5), pendingChangeRequests = new IntSet(1), pendingDestructionRequests = new IntSet(1);
 
-	/** Pool for Pairs used internally */
-	private final Pool<Pair> pairPool = new Pool<Pair>(5, 30) {
-		@Override
-		protected Pair newObject() {
-			return new Pair();
-		}
-	};
-
 	public WorldClient() {
 		this(new WorldUpdater());
 	}

          
@@ 148,9 139,9 @@ public class WorldClient extends Listene
 	public void received(Connection connection, Object obj) {
 		if(obj instanceof Update) {
 			Update update = (Update) obj;
-			@SuppressWarnings("unchecked")
-			Pair<Update, Connection> pair = pairPool.obtain();
 			synchronized(updates) {
+				@SuppressWarnings("unchecked")
+				Pair<Update, Connection> pair = Pools.obtain(Pair.class);
 				updates.add(pair.set(update, connection));
 			}
 		} else if(obj instanceof UpdateRequest.Refusal) {

          
@@ 182,7 173,7 @@ public class WorldClient extends Listene
 				Update update = pair.getKey();
 				if(updater.update(world, update, updaterListener) || update instanceof Destruction || update instanceof Creation && duplicateCreations.remove((Creation) update)) {
 					updates.remove();
-					pairPool.free(pair);
+					Pools.free(pair);
 				}
 				pair = updates.next();
 			}