Repository: activemq
Updated Branches:
  refs/heads/activemq-5.12.x a38c3d4b6 -> 961770072


https://issues.apache.org/jira/browse/AMQ-6066

Improving performance of OrderedPendingList contains method

Thanks for David Sitsky for the patch

(cherry picked from commit 673c2928a1b567958c2d9eabe2995a039f2aa1e2)


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/96177007
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/96177007
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/96177007

Branch: refs/heads/activemq-5.12.x
Commit: 9617700725182c9d2b8ea475b75a5dec6b17ad10
Parents: a38c3d4
Author: Christopher L. Shannon <christopher.l.shan...@gmail.com>
Authored: Sat Nov 28 13:25:53 2015 -0500
Committer: Christopher L. Shannon (cshannon) <christopher.l.shan...@gmail.com>
Committed: Mon Nov 30 19:20:35 2015 +0000

----------------------------------------------------------------------
 .../activemq/broker/region/cursors/OrderedPendingList.java     | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/96177007/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/OrderedPendingList.java
----------------------------------------------------------------------
diff --git 
a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/OrderedPendingList.java
 
b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/OrderedPendingList.java
index 9bf9588..e7d025c 100644
--- 
a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/OrderedPendingList.java
+++ 
b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/OrderedPendingList.java
@@ -137,11 +137,7 @@ public class OrderedPendingList implements PendingList {
     @Override
     public boolean contains(MessageReference message) {
         if (message != null) {
-            for (PendingNode value : map.values()) {
-                if (value.getMessage().equals(message)) {
-                    return true;
-                }
-            }
+            return this.map.containsKey(message.getMessageId());
         }
         return false;
     }

Reply via email to