commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arne Plöse (Commented) (JIRA) <j...@apache.org>
Subject [jira] [Commented] (MATH-627) superfluously null check of SparseIterator.next()
Date Fri, 13 Apr 2012 16:53:16 GMT

    [ https://issues.apache.org/jira/browse/MATH-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253536#comment-13253536
] 

Arne Plöse commented on MATH-627:
---------------------------------

Sorry for beeing sloppy...

If you look at ArrayRealVector you will find this construct:
{code}
            while (it.hasNext() && (e = it.next()) != null) {...}
{code}            
the same can also be found in RealVector 
                
> 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öse
>            Priority: Minor
>             Fix For: 3.1
>
>
> Looking at the implementation of SparseIterator in OpenMapRealVector.OpenMapSparseIterator
there is no chance that the entry return by next() is ever 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 administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message