lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/3] lucenenet git commit: Added ToArray method to the PQ.
Date Thu, 19 Feb 2015 09:41:47 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master ecdbcbb66 -> a3220b511


Added ToArray method to the PQ.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/eb8a9629
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/eb8a9629
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/eb8a9629

Branch: refs/heads/master
Commit: eb8a9629eecd50d58f8424d8f836cc3eda02390e
Parents: ecdbcbb
Author: Guido Tagliavini Ponce <t-gupon@microsoft.com>
Authored: Wed Feb 18 12:01:33 2015 -0800
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Thu Feb 19 10:38:49 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/PriorityQueue.cs | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/eb8a9629/src/Lucene.Net.Core/Util/PriorityQueue.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/PriorityQueue.cs b/src/Lucene.Net.Core/Util/PriorityQueue.cs
index 3938745..8ed5705 100644
--- a/src/Lucene.Net.Core/Util/PriorityQueue.cs
+++ b/src/Lucene.Net.Core/Util/PriorityQueue.cs
@@ -323,5 +323,12 @@ namespace Lucene.Net.Util
                 return (object[])(Array)Heap;
             }
         }
+
+        public T[] ToArray()
+        {
+            var copy = new T[QueueSize];
+            Array.Copy(Heap, 1, copy, 0, QueueSize);
+            return copy;
+        }
     }
 }
\ No newline at end of file


Mime
View raw message