Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 64496 invoked from network); 5 Aug 2008 04:17:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Aug 2008 04:17:17 -0000 Received: (qmail 79823 invoked by uid 500); 5 Aug 2008 04:17:12 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 79466 invoked by uid 500); 5 Aug 2008 04:17:11 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 78727 invoked by uid 99); 5 Aug 2008 04:17:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 21:17:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Aug 2008 04:16:22 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2C9A1234C18B for ; Mon, 4 Aug 2008 21:16:50 -0700 (PDT) Message-ID: <443416434.1217909810181.JavaMail.jira@brutus> Date: Mon, 4 Aug 2008 21:16:50 -0700 (PDT) From: "Junjie Peng (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-3798) Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore() In-Reply-To: <60098412.1216979251862.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Junjie Peng updated DERBY-3798: ------------------------------- Attachment: derby-3798-1.stat derby-3798-1.patch Hi, Knut. I agree with you. I have do the change as you suggested. Besides, remove an variable never used. Please check it! > Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore() > --------------------------------------------------------------------------------- > > Key: DERBY-3798 > URL: https://issues.apache.org/jira/browse/DERBY-3798 > Project: Derby > Issue Type: Improvement > Components: Newcomer, SQL > Affects Versions: 10.5.0.0 > Reporter: Knut Anders Hatlen > Assignee: Junjie Peng > Priority: Trivial > Attachments: derby-3798-1.patch, derby-3798-1.stat > > > I came across this piece of code in TableScanResultSet.getNextRowCore(): > if (past2FutureTbl.get(rowLoc) != null) > { > past2FutureTbl.remove(rowLoc); > continue; > } > I believe the call to Hashtable.get() is unnecessary since Hashtable.remove() returns the object it removed or null if the key was not in the table. So I believe the code could be simplified like this without changing the behaviour: > if (past2FutureTbl.remove(rowLoc) != null) { > continue; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.