有人可以帮我优化这段代码吗?
public final List<Double> Imprve() {
List<Double> locDbValueList = new LinkedList<Double> ();
for (int i = 0; i < 50000; ++i) {
Calendar locMyCalendar = new GregorianCalendar ();
locDbValueList.add(getNewDbValue(locMyCalendar.get(Calendar.YEAR), i));
}
updateList(locDbValueList) ;
Integer locResult = 0 ;
for (int i = 0; i < locDbValueList.size(); ++i) {
final Integer locTempVal = doOperation(locDbValueList.get(i));
if (locTempVal != null) {
locResult += locTempVal;
}
}
applyResult(locResult) ;
return locDbValueList;
}
private Double getNewDbValue(int parYear, int parIdx) { … }
private void updateList(List<Double> valList) { … } //Modifies value not size
private int doOperation (Double parDbRefValue) { … }
private void applyResult (int parIntValue) { … }*
我想修改类 Imprve 以提高功能的及时性。