tiny simplifications regarding usage of Iterator

This commit is contained in:
stsypanov
2019-03-13 21:46:53 +02:00
committed by Juergen Hoeller
parent 8f972a5a60
commit 4cc7b9b9fc
2 changed files with 8 additions and 11 deletions

View File

@@ -21,7 +21,6 @@ import java.sql.SQLException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.Iterator;
import java.util.List;
import javax.sql.DataSource;
@@ -230,9 +229,8 @@ public class BatchSqlUpdate extends SqlUpdate {
*/
public int[] getRowsAffected() {
int[] result = new int[this.rowsAffected.size()];
int i = 0;
for (Iterator<Integer> it = this.rowsAffected.iterator(); it.hasNext(); i++) {
result[i] = it.next();
for (int i = 0; i < this.rowsAffected.size(); i++) {
result[i] = this.rowsAffected.get(i);
}
return result;
}