Skip to content

Commit

Permalink
Merge pull request #1387 from ashitsalesforce/master
Browse files Browse the repository at this point in the history
Speed improvement - Avoid unnecessary copy of a part of an ArrayList
  • Loading branch information
ashitsalesforce authored Nov 26, 2024
2 parents a6d8047 + 4ccafa9 commit 9e07e27
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,7 @@ private void processResults(final DataReader dataReader, final BatchInfo batch,
final int totalRowsInDAOInCurrentBatch = lastDAORowForCurrentBatch - this.firstDAORowForCurrentBatch + 1;
List<TableRow> rows;
if (controller.getAppConfig().getBoolean(AppConfig.PROP_PROCESS_BULK_CACHE_DATA_FROM_DAO)) {
rows = new ArrayList<TableRow>();
for (int i=0; i<totalRowsInDAOInCurrentBatch; i++) {
rows.add(i, this.daoRowList.get(i + this.firstDAORowForCurrentBatch));
}
rows = this.daoRowList.subList(firstDAORowForCurrentBatch, firstDAORowForCurrentBatch+totalRowsInDAOInCurrentBatch);
} else {
rows = dataReader.readTableRowList(totalRowsInDAOInCurrentBatch);
}
Expand Down

0 comments on commit 9e07e27

Please sign in to comment.