Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4944718CB5 for ; Sat, 28 Nov 2015 18:26:54 +0000 (UTC) Received: (qmail 93425 invoked by uid 500); 28 Nov 2015 18:26:54 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 93384 invoked by uid 500); 28 Nov 2015 18:26:54 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 93375 invoked by uid 99); 28 Nov 2015 18:26:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Nov 2015 18:26:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 07815DFCE4; Sat, 28 Nov 2015 18:26:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cshannon@apache.org To: commits@activemq.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: activemq git commit: https://issues.apache.org/jira/browse/AMQ-6066 Date: Sat, 28 Nov 2015 18:26:54 +0000 (UTC) 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 Authored: Sat Nov 28 13:25:53 2015 -0500 Committer: Christopher L. Shannon 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; }