Browse Source

Merge pull request #1121 from wenyi-zhou/master

解决当Data是LinkedList时,随着数据量增加性能变差
2.1.x
Jiaju Zhuang 5 years ago committed by GitHub
parent
commit
66601b0daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java

6
src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java

@ -46,9 +46,11 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor {
}
// BeanMap is out of order,so use fieldList
List<Field> fieldList = new ArrayList<Field>();
for (int relativeRowIndex = 0; relativeRowIndex < data.size(); relativeRowIndex++) {
int relativeRowIndex=0;
for(Object oneRowData : data){
int n = relativeRowIndex + newRowIndex;
addOneRowOfDataToExcel(data.get(relativeRowIndex), n, relativeRowIndex, fieldList);
addOneRowOfDataToExcel(oneRowData, n, relativeRowIndex, fieldList);
relativeRowIndex++;
}
}

Loading…
Cancel
Save