activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6066
Date Sat, 28 Nov 2015 18:26:54 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 2aa172f90 -> 673c2928a


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

Improving performance of OrderedPendingList contains method

Thanks for David Sitsky for the patch


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

Branch: refs/heads/master
Commit: 673c2928a1b567958c2d9eabe2995a039f2aa1e2
Parents: 2aa172f
Author: Christopher L. Shannon <christopher.l.shannon@gmail.com>
Authored: Sat Nov 28 13:25:53 2015 -0500
Committer: Christopher L. Shannon <christopher.l.shannon@gmail.com>
Committed: Sat Nov 28 13:25:53 2015 -0500

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/673c2928/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 31870b1..28fc13c 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
@@ -162,11 +162,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;
     }


Mime
View raw message