commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary D. Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-804) Redundant check for zero in HashCodeBuilder ctor
Date Wed, 30 May 2012 01:57:23 GMT

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

Gary D. Gregory commented on LANG-804:
--------------------------------------

If you remove the  == 0 checks, you'd get a  / 0 error on 0 input on the % 2 checks. The current
code is pretty simple and straightforward. What would be an alt impl?
                
> Redundant check for zero in HashCodeBuilder ctor
> ------------------------------------------------
>
>                 Key: LANG-804
>                 URL: https://issues.apache.org/jira/browse/LANG-804
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Sebb
>            Priority: Minor
>
> The HashCodeBuilder(int, int) ctor checks both parameters for zero, as well as checking
for an odd number.
> Zero is never odd, so the zero check could be eliminated.

--
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