[ 
https://issues.apache.org/jira/browse/LUCENE-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon Willnauer updated LUCENE-2195:
------------------------------------

    Attachment: LUCENE-2195.patch

I changed my patch to please Yonik who has performance concerns as well as 
robert who wants to use EMTPY_SET instead of set == null checks. 
I agree with robert that I would rather have an empty set instead of null 
asssigned if the set is omitted or if the default set is empty. Yet, I 
subclassed UnmodifiableCharArraySet and added a specailized implementation for 
EMPTY_SET that checks for null to throw the NPE and otherwise always returns 
false for all contains(...) methods.
This class is final and the overhead for the method call should be very small.

 

> 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, 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to