Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EEC889114 for ; Thu, 10 May 2012 12:32:12 +0000 (UTC) Received: (qmail 9423 invoked by uid 500); 10 May 2012 12:32:12 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 9398 invoked by uid 500); 10 May 2012 12:32:12 -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 9389 invoked by uid 99); 10 May 2012 12:32:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 12:32:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 12:32:10 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 9C8E7141BC for ; Thu, 10 May 2012 12:31:49 +0000 (UTC) Date: Thu, 10 May 2012 12:31:49 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: <56171802.49037.1336653109642.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <508575591.49019.1336652508850.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (DERBY-5755) Minor cleanup of DataDictionaryImpl.getRoutineList() 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/DERBY-5755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-5755: -------------------------------------- Attachment: d5755-1a.diff Attaching a patch that makes the suggested changes to the method. All the regression tests passed with the patch. > Minor cleanup of DataDictionaryImpl.getRoutineList() > ---------------------------------------------------- > > Key: DERBY-5755 > URL: https://issues.apache.org/jira/browse/DERBY-5755 > Project: Derby > Issue Type: Improvement > Components: SQL > Affects Versions: 10.9.0.0 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Priority: Trivial > Attachments: d5755-1a.diff > > > I noticed two small possibilities for improvement in DataDictionaryImpl.getRoutineList() when I worked on DERBY-5730: > - The method always returns a list of one or zero items. Instead of creating an ArrayList, it should use Collections.singletonList() and Collections.EMPTY_LIST, which are more memory-efficient. > - It loops through the entire SYSFUN_FUNCTIONS array, even if the matching function is found in the first cell of the array. It should break out of the loop once a match is found. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira