1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Use more efficient entrySet iterator instead of keySet + get()

The loop extracted keys from `folderMap` and then called
`folderMap.get(...)` for every key. If both the key and the value needs
to be iterated on, `Map.entrySet()` is a more efficient solution as it
doesn't require O(n) Map lookups.
This commit is contained in:
András Veres-Szentkirályi 2014-02-15 21:38:05 +01:00
parent 28398dbdad
commit 309a4d6107

View File

@ -2667,8 +2667,9 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
outMessages.add(message);
}
for (String folderName : folderMap.keySet()) {
List<Message> outMessages = folderMap.get(folderName);
for (Map.Entry<String, List<Message>> entry : folderMap.entrySet()) {
String folderName = entry.getKey();
List<Message> outMessages = entry.getValue();
Account account = outMessages.get(0).getFolder().getAccount();
if (operation == FolderOperation.MOVE) {