lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rory Plaire <codekai...@gmail.com>
Subject Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.
Date Tue, 17 May 2011 23:14:20 GMT
This is a great improvement, but why not also remove the braces and returns?


var cache = new FilterCache<DocIdSet>(deletesMode,
  (reader, docIdSet) => new FilteredDocIdSet(
   (DocIdSet)docIdSet, docid => !reader.IsDeleted(docid)));


On Tue, May 17, 2011 at 3:01 PM, Digy (JIRA) <jira@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035092#comment-13035092]
>
> Digy commented on LUCENENET-412:
> --------------------------------
>
> One more sample
> {code}
> From:
>        class AnonymousFilterCache : FilterCache
>        {
>                class AnonymousFilteredDocIdSet : FilteredDocIdSet
>                {
>                        IndexReader r;
>                        public AnonymousFilteredDocIdSet(DocIdSet innerSet,
> IndexReader r) : base(innerSet)
>                        {
>                                this.r = r;
>                        }
>                        public override bool Match(int docid)
>                        {
>                                return !r.IsDeleted(docid);
>                        }
>                }
>
>                public AnonymousFilterCache(DeletesMode deletesMode) :
> base(deletesMode)
>                {
>                }
>
>                protected  override object MergeDeletes(IndexReader reader,
> object docIdSet)
>                {
>                        return new
> AnonymousFilteredDocIdSet((DocIdSet)docIdSet, reader);
>                }
>        }
>        .......
>        cache = new AnonymousFilterCache(deletesMode);
>
>
>
> To:
>        cache = new FilterCache<DocIdSet>(deletesMode,
>                (reader,docIdSet)=>{
>                        return new FilteredDocIdSet((DocIdSet)docIdSet,
>                        (docid) =>
>                        {
>                                return !reader.IsDeleted(docid);
>                        });
>                 });
> {code}
>
> DIGY
>
> > Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> > ----------------------------------------------------------------
> >
> >                 Key: LUCENENET-412
> >                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
> >             Project: Lucene.Net
> >          Issue Type: Improvement
> >    Affects Versions: Lucene.Net 2.9.4
> >            Reporter: Digy
> >            Priority: Minor
> >             Fix For: Lucene.Net 2.9.4
> >
> >         Attachments: IEquatable for Query&Subclasses.patch,
> LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
> >
> >
> > This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some
> performance gains.
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message