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
experimental
phr00t 11 years ago
parent 7bb046730f
commit 77a2af25c4
  1. 7
      engine/src/core/com/jme3/shader/DefineList.java

@ -34,9 +34,9 @@ package com.jme3.shader;
import com.jme3.export.*; import com.jme3.export.*;
import com.jme3.material.MatParam; import com.jme3.material.MatParam;
import com.jme3.material.TechniqueDef; import com.jme3.material.TechniqueDef;
import com.jme3.util.ListMap;
import java.io.IOException; import java.io.IOException;
import java.util.Collection;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
@ -182,11 +182,12 @@ public class DefineList implements Savable, Cloneable {
return defines.equals(other.defines); return defines.equals(other.defines);
} }
public boolean equalsParams(Collection<MatParam> params, TechniqueDef def) { public boolean equalsParams(ListMap params, TechniqueDef def) {
int size = 0; 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()); String key = def.getShaderParamDefine(param.getName());
if (key != null) { if (key != null) {
Object val = param.getValue(); Object val = param.getValue();

Loading…
Cancel
Save