[
https://issues.apache.org/jira/browse/GROOVY-7834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15426284#comment-15426284
]
ASF GitHub Bot commented on GROOVY-7834:
----------------------------------------
GitHub user upadhyayap opened a pull request:
https://github.com/apache/groovy/pull/386
Calculating hashCode of IntRange by pairing function
https://issues.apache.org/jira/browse/GROOVY-7834?jql=status%20%3D%20Open%20AND%20project%20%3D%20Groovy%20AND%20type%20%3D%20Bug%20ORDER%20BY%20created%20DESC
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/upadhyayap/incubator-groovy GROOVY-7834
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/386.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #386
----
commit 256a9f462b066cd4a2dfc124c0fb6c5b4edfccd8
Author: Anand upadhyay <[email protected]>
Date: 2016-08-18T11:09:00Z
Calculating hashCode of IntRange by pairing function
----
> Calling hashCode on IntRange iterates through all elements in the range.
> ------------------------------------------------------------------------
>
> Key: GROOVY-7834
> URL: https://issues.apache.org/jira/browse/GROOVY-7834
> Project: Groovy
> Issue Type: Bug
> Reporter: howard zhang
>
> {code}
> new IntRange(0, Integer.MAX_VALUE-1).hashCode()
> {code}
> The above code takes a few seconds to complete.
> I believe the hashCode method is not overridden and it defaults to
> AbstractList which iterates through all elements. I don't think this should
> be the default behavior.
> http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/AbstractList.java/?v=source
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)