>>Is it correct to compare using '==' or equals should be used instead?
In this context it is OK. Term fieldnames are deliberately interned using String.intern() so this equality test can be used. The intention is to make comparisons faster. Cheers, Mark ----- Original Message ---- From: dmitri <[EMAIL PROTECTED]> To: java-dev@lucene.apache.org Sent: Wednesday, 21 March, 2007 12:04:27 PM Subject: Is this correct: term.field() == fieldName ? In the org.apache.lucene.search.PrefixFilter I've found: ...... if (term != null && term.text().startsWith(prefixText) && term.field() == prefixField) { ........................ Is it correct to compare using '==' or equals should be used instead? ------------- Dmitri. -- View this message in context: http://www.nabble.com/Is-this-correct%3A-term.field%28%29-%3D%3D-fieldName---tf3440232.html#a9592526 Sent from the Lucene - Java Developer mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___________________________________________________________ New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes. http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]