HHH-14248 Refactor latestBatches from InsertActionSorter's field to temporary variable in its sort method

This commit is contained in:
Nathan Xu 2020-10-06 10:28:58 -04:00 committed by Sanne Grinovero
parent 112d215371
commit c3e43ecd11
1 changed files with 3 additions and 4 deletions

View File

@ -1129,9 +1129,6 @@ public class ActionQueue {
}
}
// the mapping of entity names to their latest batch numbers.
private List<BatchIdentifier> latestBatches;
// the map of batch numbers to EntityInsertAction lists
private Map<BatchIdentifier, List<AbstractEntityInsertAction>> actionBatches;
@ -1143,9 +1140,11 @@ public class ActionQueue {
*/
public void sort(List<AbstractEntityInsertAction> insertions) {
// optimize the hash size to eliminate a rehash.
this.latestBatches = new ArrayList<>( );
this.actionBatches = new HashMap<>();
// the mapping of entity names to their latest batch numbers.
final List<BatchIdentifier> latestBatches = new ArrayList<>();
for ( AbstractEntityInsertAction action : insertions ) {
BatchIdentifier batchIdentifier = new BatchIdentifier(
action.getEntityName(),