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 5E6359E6F for ; Fri, 13 Apr 2012 16:53:38 +0000 (UTC) Received: (qmail 64624 invoked by uid 500); 13 Apr 2012 16:53:38 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 64557 invoked by uid 500); 13 Apr 2012 16:53:38 -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 64547 invoked by uid 99); 13 Apr 2012 16:53:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2012 16:53:37 +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; Fri, 13 Apr 2012 16:53:36 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DC708369321 for ; Fri, 13 Apr 2012 16:53:16 +0000 (UTC) Date: Fri, 13 Apr 2012 16:53:16 +0000 (UTC) From: =?utf-8?Q?Arne_Pl=C3=B6se_=28Commented=29_=28JIRA=29?= To: issues@commons.apache.org Message-ID: <1224759864.22684.1334335996904.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <702338865.13894.1311317217730.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-627) superfluously null check of SparseIterator.next() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-627?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D132535= 36#comment-13253536 ]=20 Arne Pl=C3=B6se commented on MATH-627: --------------------------------- Sorry for beeing sloppy... If you look at ArrayRealVector you will find this construct: {code} while (it.hasNext() && (e =3D it.next()) !=3D null) {...} {code} =20 the same can also be found in RealVector=20 =20 > superfluously null check of SparseIterator.next() > ------------------------------------------------- > > Key: MATH-627 > URL: https://issues.apache.org/jira/browse/MATH-627 > Project: Commons Math > Issue Type: Improvement > Reporter: Arne Pl=C3=B6se > Priority: Minor > Fix For: 3.1 > > > Looking at the implementation of SparseIterator in OpenMapRealVector.Open= MapSparseIterator there is no chance that the entry return by next() is eve= r null - so there is no need to chek this in nearly every loop? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira