You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cs...@apache.org on 2015/11/28 19:26:54 UTC
activemq git commit: https://issues.apache.org/jira/browse/AMQ-6066
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 <ch...@gmail.com>
Authored: Sat Nov 28 13:25:53 2015 -0500
Committer: Christopher L. Shannon <ch...@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;
}