From 77a2af25c4325522633a26100ca7a5e5222b6913 Mon Sep 17 00:00:00 2001 From: phr00t Date: Tue, 4 Feb 2014 16:07:46 +0000 Subject: [PATCH] avoids creating iterators, accesses param's backing array directly for greater performance git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@11011 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/shader/DefineList.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/engine/src/core/com/jme3/shader/DefineList.java b/engine/src/core/com/jme3/shader/DefineList.java index 511cd03b1..144cbb088 100644 --- a/engine/src/core/com/jme3/shader/DefineList.java +++ b/engine/src/core/com/jme3/shader/DefineList.java @@ -34,9 +34,9 @@ package com.jme3.shader; import com.jme3.export.*; import com.jme3.material.MatParam; import com.jme3.material.TechniqueDef; +import com.jme3.util.ListMap; import java.io.IOException; -import java.util.Collection; import java.util.Map; import java.util.TreeMap; @@ -182,11 +182,12 @@ public class DefineList implements Savable, Cloneable { return defines.equals(other.defines); } - public boolean equalsParams(Collection params, TechniqueDef def) { - + public boolean equalsParams(ListMap params, TechniqueDef def) { + int size = 0; - for (MatParam param : params) { + for(int i = 0; i < params.size() ; i++ ) { + MatParam param = (MatParam)params.getValue(i); String key = def.getShaderParamDefine(param.getName()); if (key != null) { Object val = param.getValue();