Browse Source

Merge pull request #1 from wenyi-zhou/wenyi-zhou-patch-1

解决当Data是LinkedList时,随着数据量增加性能变差
pull/1121/head
Wenyi Zhou 5 years ago committed by GitHub
parent
commit
89edafaaef
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