lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [21/46] lucenenet git commit: Fixed Facet.Taxonomy.Directory.TaxonomyIndexArrays _renamed variable names.
Date Tue, 04 Oct 2016 20:01:51 GMT
Fixed Facet.Taxonomy.Directory.TaxonomyIndexArrays _renamed variable names.


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

Branch: refs/heads/master
Commit: 8d23d138ac51e8a73d87ab13b2cb657d06263f87
Parents: e4b7e0b
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Sep 25 13:22:53 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Mon Oct 3 23:31:21 2016 +0700

----------------------------------------------------------------------
 .../Taxonomy/Directory/TaxonomyIndexArrays.cs   | 52 ++++++++++----------
 1 file changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8d23d138/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs b/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs
index 2319550..ec0b33a 100644
--- a/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/Directory/TaxonomyIndexArrays.cs
@@ -35,26 +35,26 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
     /// </summary>
     internal class TaxonomyIndexArrays : ParallelTaxonomyArrays
     {
-        private readonly int[] parents_Renamed;
+        private readonly int[] parents;
 
         // the following two arrays are lazily intialized. note that we only keep a
         // single boolean member as volatile, instead of declaring the arrays
         // volatile. the code guarantees that only after the boolean is set to true,
         // the arrays are returned.
         private volatile bool initializedChildren = false;
-        private int[] children_Renamed, siblings_Renamed;
+        private int[] children, siblings;
 
         /// <summary>
         /// Used by <seealso cref="#add(int, int)"/> after the array grew. </summary>
         private TaxonomyIndexArrays(int[] parents)
         {
-            this.parents_Renamed = parents;
+            this.parents = parents;
         }
 
         public TaxonomyIndexArrays(IndexReader reader)
         {
-            parents_Renamed = new int[reader.MaxDoc];
-            if (parents_Renamed.Length > 0)
+            parents = new int[reader.MaxDoc];
+            if (parents.Length > 0)
             {
                 InitParents(reader, 0);
                 // Starting Lucene 2.9, following the change LUCENE-1542, we can
@@ -64,7 +64,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
                 // with existing indexes, so what we'll do instead is just
                 // hard-code the parent of ordinal 0 to be -1, and assume (as is
                 // indeed the case) that no other parent can be -1.
-                parents_Renamed[0] = TaxonomyReader.INVALID_ORDINAL;
+                parents[0] = TaxonomyReader.INVALID_ORDINAL;
             }
         }
 
@@ -77,8 +77,8 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             // NRT reader was obtained, even though nothing was changed. this is not very
likely
             // to happen.
             int[] copyParents = copyFrom.Parents();
-            this.parents_Renamed = new int[reader.MaxDoc];
-            Array.Copy(copyParents, 0, parents_Renamed, 0, copyParents.Length);
+            this.parents = new int[reader.MaxDoc];
+            Array.Copy(copyParents, 0, parents, 0, copyParents.Length);
             InitParents(reader, copyParents.Length);
 
             if (copyFrom.initializedChildren)
@@ -93,14 +93,14 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             {
                 if (!initializedChildren) // must do this check !
                 {
-                    children_Renamed = new int[parents_Renamed.Length];
-                    siblings_Renamed = new int[parents_Renamed.Length];
+                    children = new int[parents.Length];
+                    siblings = new int[parents.Length];
                     if (copyFrom != null)
                     {
                         // called from the ctor, after we know copyFrom has initialized children/siblings
-                        Array.Copy(copyFrom.Children(), 0, children_Renamed, 0, copyFrom.Children().Length);
-                        Array.Copy(copyFrom.Siblings(), 0, siblings_Renamed, 0, copyFrom.Siblings().Length);
-                        ComputeChildrenSiblings(copyFrom.parents_Renamed.Length);
+                        Array.Copy(copyFrom.Children(), 0, children, 0, copyFrom.Children().Length);
+                        Array.Copy(copyFrom.Siblings(), 0, siblings, 0, copyFrom.Siblings().Length);
+                        ComputeChildrenSiblings(copyFrom.parents.Length);
                     }
                     else
                     {
@@ -116,24 +116,24 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             // reset the youngest child of all ordinals. while this should be done only
             // for the leaves, we don't know up front which are the leaves, so we reset
             // all of them.
-            for (int i = first; i < parents_Renamed.Length; i++)
+            for (int i = first; i < parents.Length; i++)
             {
-                children_Renamed[i] = TaxonomyReader.INVALID_ORDINAL;
+                children[i] = TaxonomyReader.INVALID_ORDINAL;
             }
 
             // the root category has no parent, and therefore no siblings
             if (first == 0)
             {
                 first = 1;
-                siblings_Renamed[0] = TaxonomyReader.INVALID_ORDINAL;
+                siblings[0] = TaxonomyReader.INVALID_ORDINAL;
             }
 
-            for (int i = first; i < parents_Renamed.Length; i++)
+            for (int i = first; i < parents.Length; i++)
             {
                 // note that parents[i] is always < i, so the right-hand-side of
                 // the following line is already set when we get here
-                siblings_Renamed[i] = children_Renamed[parents_Renamed[i]];
-                children_Renamed[parents_Renamed[i]] = i;
+                siblings[i] = children[parents[i]];
+                children[parents[i]] = i;
             }
         }
 
@@ -166,7 +166,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
                         throw new CorruptIndexException("Missing parent data for category
" + i);
                     }
 
-                    parents_Renamed[i] = positions.NextPosition();
+                    parents[i] = positions.NextPosition();
 
                     if (positions.NextDoc() == DocIdSetIterator.NO_MORE_DOCS)
                     {
@@ -193,13 +193,13 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
         /// </summary>
         internal virtual TaxonomyIndexArrays Add(int ordinal, int parentOrdinal)
         {
-            if (ordinal >= parents_Renamed.Length)
+            if (ordinal >= parents.Length)
             {
-                int[] newarray = ArrayUtil.Grow(parents_Renamed, ordinal + 1);
+                int[] newarray = ArrayUtil.Grow(parents, ordinal + 1);
                 newarray[ordinal] = parentOrdinal;
                 return new TaxonomyIndexArrays(newarray);
             }
-            parents_Renamed[ordinal] = parentOrdinal;
+            parents[ordinal] = parentOrdinal;
             return this;
         }
 
@@ -209,7 +209,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
         /// </summary>
         public override int[] Parents()
         {
-            return parents_Renamed;
+            return parents;
         }
 
         /// <summary>
@@ -226,7 +226,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             }
 
             // the array is guaranteed to be populated
-            return children_Renamed;
+            return children;
         }
 
         /// <summary>
@@ -242,7 +242,7 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             }
 
             // the array is guaranteed to be populated
-            return siblings_Renamed;
+            return siblings;
         }
     }
 }
\ No newline at end of file


Mime
View raw message