3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 06:44:16 +00:00

Minor efficiency improvement: use entrySet() instead of keySet()+get(). Clears out a FindBugs warning.

This commit is contained in:
Mike Hearn 2011-08-05 20:39:12 +00:00
parent 58b18fa724
commit 48fce919aa

View File

@ -308,11 +308,11 @@ public class BlockChain {
private void sendTransactionsToWallet(StoredBlock block, NewBlockType blockType, private void sendTransactionsToWallet(StoredBlock block, NewBlockType blockType,
HashMap<Wallet, List<Transaction>> newTransactions) throws VerificationException { HashMap<Wallet, List<Transaction>> newTransactions) throws VerificationException {
for (Wallet wallet : newTransactions.keySet()) { for (Map.Entry<Wallet, List<Transaction>> entry : newTransactions.entrySet()) {
try { try {
List<Transaction> txns = newTransactions.get(wallet); List<Transaction> txns = entry.getValue();
for (Transaction tx : txns) { for (Transaction tx : txns) {
wallet.receive(tx, block, blockType); entry.getKey().receive(tx, block, blockType);
} }
} catch (ScriptException e) { } catch (ScriptException e) {
// We don't want scripts we don't understand to break the block chain so just note that this tx was // We don't want scripts we don't understand to break the block chain so just note that this tx was