You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Yonik Seeley (JIRA)" <ji...@apache.org> on 2005/12/23 17:29:30 UTC

[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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org