Only get Fields to Interpolate in Interpolation implementations if not done before -> massive performance increase

This commit is contained in:
CrushedPixel
2015-07-20 01:16:53 +02:00
parent 9b76bcadcb
commit d9e2c2a7c8
2 changed files with 8 additions and 4 deletions

View File

@@ -22,8 +22,10 @@ public class GenericLinearInterpolation<T extends KeyframeValue> implements Inte
public void addPoint(T point) {
points.add(point);
List<Field> fields = ReflectionUtils.getFieldsToInterpolate(point.getClass());
this.fields = fields.toArray(new Field[fields.size()]);
if(fields == null) {
List<Field> fields = ReflectionUtils.getFieldsToInterpolate(point.getClass());
this.fields = fields.toArray(new Field[fields.size()]);
}
}
@Override

View File

@@ -22,8 +22,10 @@ public class GenericSplineInterpolation<T extends KeyframeValue> extends BasicSp
public void addPoint(T point) {
this.points.add(point);
List<Field> fields = ReflectionUtils.getFieldsToInterpolate(point.getClass());
this.fields = fields.toArray(new Field[fields.size()]);
if(fields == null) {
List<Field> fields = ReflectionUtils.getFieldsToInterpolate(point.getClass());
this.fields = fields.toArray(new Field[fields.size()]);
}
}
@Override