lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] Commented: (LUCENE-460) hashCode improvements
Date Fri, 23 Dec 2005 16:29:30 GMT
    [ ] 

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:
>      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:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message