Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

[jira] Commented: (LUCENE-460) hashCode improvements

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


jira at apache

Dec 23, 2005, 8:29 AM

Post #1 of 1 (454 views)
Permalink
[jira] Commented: (LUCENE-460) hashCode improvements

[ http://issues.apache.org/jira/browse/LUCENE-460?page=comments#action_12361200 ]

Yonik Seeley commented on LUCENE-460:
-------------------------------------

Some people have asked where some of the magic constants come from in the hashCodes:

> python -c "import random;print hex(random.getrandbits(32))[:-1]"
> Just a way of making some things unique.... let me know if you have a
> better idea on that.
>
> So those constants are just random numbers. I thought about trying to pick magic numbers to maximize hamming distances, etc,
> but it's more work and more likely to mess things up if you get it wrong. getClass().hashCode() would also work, but it would be
> slower.


> hashCode improvements
> ---------------------
>
> Key: LUCENE-460
> URL: http://issues.apache.org/jira/browse/LUCENE-460
> Project: Lucene - Java
> Type: Improvement
> Components: Search
> Versions: CVS Nightly - Specify date in submission
> Reporter: Yonik Seeley
> Priority: Minor
> Fix For: CVS Nightly - Specify date in submission

>
> It would be nice for all Query classes to implement hashCode and equals to enable them to be used as keys when caching.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.