Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3ED2710A44 for ; Mon, 3 Jun 2013 23:00:25 +0000 (UTC) Received: (qmail 75497 invoked by uid 500); 3 Jun 2013 23:00:22 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 75419 invoked by uid 500); 3 Jun 2013 23:00:22 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 75356 invoked by uid 99); 3 Jun 2013 23:00:22 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jun 2013 23:00:21 +0000 Date: Mon, 3 Jun 2013 23:00:21 +0000 (UTC) From: "Adrian Nistor (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (COLLECTIONS-472) wasted work in AbstractMapBag.containsAll() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COLLECTIONS-472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Nistor updated COLLECTIONS-472: -------------------------------------- Attachment: patch.diff > wasted work in AbstractMapBag.containsAll() > ------------------------------------------- > > Key: COLLECTIONS-472 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-472 > Project: Commons Collections > Issue Type: Bug > Components: Bag > Affects Versions: 3.2.1 > Environment: any > Reporter: Adrian Nistor > Labels: patch,, performance > Attachments: patch.diff > > > The problem appears in version 3.2.1 and in revision 1489197. I > attached a one-line patch that fixes it. > In method "AbstractMapBag.containsAll", the loop over > "other.uniqueSet()" should return immediately after "result" becomes > "false", because "result = result && contains;" can never become > "true" again. All the iterations after "result" becomes "false" do > not perform any useful work, at best they just set "result" again to > "false". -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira