mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-30 23:00:09 -05:00
replaced for with for-each loop and optimized List implementation
This commit is contained in:
parent
1202f5109a
commit
1bc3271de3
@ -619,9 +619,9 @@ public class Account implements BaseAccount {
|
|||||||
|
|
||||||
public static List<Integer> getExistingAccountNumbers(Preferences preferences) {
|
public static List<Integer> getExistingAccountNumbers(Preferences preferences) {
|
||||||
Account[] accounts = preferences.getAccounts();
|
Account[] accounts = preferences.getAccounts();
|
||||||
List<Integer> accountNumbers = new LinkedList<Integer>();
|
List<Integer> accountNumbers = new ArrayList<Integer>(accounts.length);
|
||||||
for (int i = 0; i < accounts.length; i++) {
|
for (Account a : accounts) {
|
||||||
accountNumbers.add(accounts[i].getAccountNumber());
|
accountNumbers.add(a.getAccountNumber());
|
||||||
}
|
}
|
||||||
return accountNumbers;
|
return accountNumbers;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user