lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject svn commit: r1375270 - /incubator/lucene.net/trunk/src/contrib/Spatial/Util/FixedBitSet.cs
Date Mon, 20 Aug 2012 21:57:48 GMT
Author: synhershko
Date: Mon Aug 20 21:57:48 2012
New Revision: 1375270

URL: http://svn.apache.org/viewvc?rev=1375270&view=rev
Log:
Properly copying FixedBitSet

Not so performant, though

Modified:
    incubator/lucene.net/trunk/src/contrib/Spatial/Util/FixedBitSet.cs

Modified: incubator/lucene.net/trunk/src/contrib/Spatial/Util/FixedBitSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Spatial/Util/FixedBitSet.cs?rev=1375270&r1=1375269&r2=1375270&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Spatial/Util/FixedBitSet.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Spatial/Util/FixedBitSet.cs Mon Aug 20 21:57:48
2012
@@ -411,9 +411,12 @@ namespace Lucene.Net.Spatial.Util
 		public override DocIdSetIterator Iterator()
 		{
 			// TODO: avoid copying, create a FixedBitSetIterator instead
-			var arr = new long[bits.Count];
-			bits.CopyTo(arr, 0);
-			return new OpenBitSetIterator(arr, bits.Length);
+			var a = new OpenBitSet();
+			for (var i = 0; i < bits.Count; i++)
+			{
+				if (bits[i]) a.Set(i);
+			}
+			return a.Iterator();
 		}
 	}
 }



Mime
View raw message