lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [29/46] lucenenet git commit: Changed Size() and Capacity() methods of Facet.Taxonomy.WriterCache.CollisionMap to Count and Capacity properties.
Date Tue, 04 Oct 2016 20:01:59 GMT
Changed Size() and Capacity() methods of Facet.Taxonomy.WriterCache.CollisionMap to Count and
Capacity properties.


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

Branch: refs/heads/master
Commit: e0d070b5de0a9329fcd4cc41afbdda2a7d6216a6
Parents: cb8d47f
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Sep 25 15:46:15 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Mon Oct 3 23:31:43 2016 +0700

----------------------------------------------------------------------
 .../Taxonomy/WriterCache/CollisionMap.cs              | 14 ++++++++++----
 .../Taxonomy/WriterCache/CompactLabelToOrdinal.cs     |  8 ++++----
 2 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0d070b5/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs b/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
index 1b2767b..b199513 100644
--- a/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/WriterCache/CollisionMap.cs
@@ -76,17 +76,23 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
 
         /// <summary>
         /// How many mappings. </summary>
-        public virtual int Size()
+        public virtual int Count
         {
-            return this.size;
+            get
+            {
+                return this.size;
+            }
         }
 
         /// <summary>
         /// How many slots are allocated. 
         /// </summary>
-        public virtual int Capacity()
+        public virtual int Capacity
         {
-            return this.capacity;
+            get
+            {
+                return this.capacity;
+            }
         }
 
         private void Grow()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e0d070b5/src/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs b/src/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs
index 94a9e38..2ba69a5 100644
--- a/src/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/WriterCache/CompactLabelToOrdinal.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
         /// How many labels. </summary>
         public virtual int SizeOfMap()
         {
-            return this.collisionMap.Size();
+            return this.collisionMap.Count;
         }
 
         private CompactLabelToOrdinal()
@@ -117,7 +117,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
 
         public override void AddLabel(FacetLabel label, int ordinal)
         {
-            if (collisionMap.Size() > threshold)
+            if (collisionMap.Count > threshold)
             {
                 Grow();
             }
@@ -205,7 +205,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
             }
 
             CollisionMap oldCollisionMap = this.collisionMap;
-            this.collisionMap = new CollisionMap(oldCollisionMap.Capacity(), this.labelRepository);
+            this.collisionMap = new CollisionMap(oldCollisionMap.Capacity, this.labelRepository);
             this.threshold = (int)(this.capacity * this.loadFactor);
 
             var it = oldCollisionMap.GetEnumerator();
@@ -245,7 +245,7 @@ namespace Lucene.Net.Facet.Taxonomy.WriterCache
 
             this.collisionMap.AddLabelOffset(hash, knownOffset, cid);
 
-            if (this.collisionMap.Size() > this.threshold)
+            if (this.collisionMap.Count > this.threshold)
             {
                 Grow();
             }


Mime
View raw message