reduce the number of times the sendSyncs map is accessed.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1482800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2013-05-15 13:02:27 +00:00
parent 0deda2501d
commit 548c19496c
1 changed files with 1 additions and 4 deletions

View File

@ -800,18 +800,15 @@ public class Queue extends BaseDestination implements Task, UsageListener {
ArrayList<SendSync> syncs = new ArrayList<SendSync>(orderedWork.size());;
sendLock.lockInterruptibly();
try {
for (Transaction tx : orderedWork) {
SendSync sync = sendSyncs.get(tx);
SendSync sync = sendSyncs.remove(tx);
sync.processSend();
syncs.add(sync);
sendSyncs.remove(tx);
}
} finally {
sendLock.unlock();
}
for (SendSync sync : syncs) {
sync.processSent();
}