[
https://issues.apache.org/jira/browse/LUCENENET-292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nicholas Paldino updated LUCENENET-292:
---------------------------------------
Attachment: SupportClass.patch
George,
This patch does the following:
- Fixes the AddRange method so that Capacity is correctly computed.
- Implements ICloneable
These two things are all that is required for LUCENENET-294 and LUCENENET-295
and nothing more.
There is code that is commented out which should be uncommented when the split
from Lucene Java is made to make the code more ".NET-like".
I'll put the optimization in another patch with a separate issue.
I suggest the title of the issue be changed, I'd do it myself, but not sure
what the reaction would be, so erring on the side of caution.
> Optimization of EquatableList<T>
> --------------------------------
>
> Key: LUCENENET-292
> URL: https://issues.apache.org/jira/browse/LUCENENET-292
> Project: Lucene.Net
> Issue Type: Improvement
> Reporter: Nicholas Paldino
> Priority: Minor
> Attachments: EquatableList3.patch, SupportClass.patch,
> SupportClass.patch
>
>
> When comparing two IEnumerable<T> implementations, a shortcut can be taken to
> check to see if both IEnumerable<T> expose operations which returns a count
> of items (sequences cannot be equal if the number of elements in the
> sequences are not equal).
> Typically, in .NET, this is expressed through the implementation of the
> ICollection or ICollection<T> interface.
> Before enumerating through each element and comparing the two for equality,
> if the counts are accessible, they should be compared to see if the number of
> elements in the two sequences are equal. If a comparison is able to be made
> before enumerating, it will be much more performant for comparisons of
> sequences where each is ~N, but both are not equal to N, and N is very large.
> Patch to follow.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.