lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy (JIRA)" <j...@apache.org>
Subject [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.
Date Tue, 17 May 2011 22:01:47 GMT

    [ 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
View raw message