[ 
https://issues.apache.org/jira/browse/LUCENE-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797701#action_12797701
 ] 

Yonik Seeley commented on LUCENE-2195:
--------------------------------------

It's not quite the same - no method call for set != null.
But my point stands - this is optimization for the very uncommon case at the 
expense of the common case.  This specific instance isn't too big of a deal 
(it's a predictable branch at least), but as a matter of principle we should 
avoid going down those roads.

> Speedup CharArraySet if set is empty
> ------------------------------------
>
>                 Key: LUCENE-2195
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2195
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Simon Willnauer
>             Fix For: 3.1
>
>         Attachments: LUCENE-2195.patch, LUCENE-2195.patch
>
>
> CharArraySet#contains(...) always creates a HashCode of the String, Char[] or 
> CharSequence even if the set is empty. 
> contains should return false if set it empty

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to