lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Spencer <>
Subject Obscure point about Term.hashCode()
Date Tue, 31 Aug 2004 19:02:33 GMT
Just stumbled across this when running Optimizeit over an app that uses 
Lucene. Isn't the XOR operator more normally used in hashCode() as it 
mixes and distributes the bits more, or is the reasoning that the hash 
code of strings are already mixed decently enough? I don't even know if 
this routine is being called -just a source code inspection question.

This is the code:

	public final int hashCode() {
		return field.hashCode() + text.hashCode();

And my suggestion means changing the "+" to a "^".

-- Dave

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

View raw message