replaced for with for-each loop and optimized List implementation

This commit is contained in:
András Veres-Szentkirályi 2014-02-15 21:58:52 +01:00
parent 1202f5109a
commit 1bc3271de3
1 changed files with 3 additions and 3 deletions

View File

@ -619,9 +619,9 @@ public class Account implements BaseAccount {
public static List<Integer> getExistingAccountNumbers(Preferences preferences) {
Account[] accounts = preferences.getAccounts();
List<Integer> accountNumbers = new LinkedList<Integer>();
for (int i = 0; i < accounts.length; i++) {
accountNumbers.add(accounts[i].getAccountNumber());
List<Integer> accountNumbers = new ArrayList<Integer>(accounts.length);
for (Account a : accounts) {
accountNumbers.add(a.getAccountNumber());
}
return accountNumbers;
}