lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: some minor fixes
Date Mon, 19 Nov 2007 07:37:12 GMT
> functionality. In someĀ  cases strings are compared with string literals
> using ==. I can give a list if anyone thinks he or she will have use for
> it. 

This is a speed optimization. All Strings compared by this function were
"interned" before. This is done for e.g. all "field" names in Lucene. On
constructing a Term, the filed name is "interned" by field.intern(). After
that, the returned sting object is a reference to a unique representation in
a string pool maintained by Java.

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#intern()

Uwe


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message