OSDN Git Service

微修正
authorkomutan <t_komuta@nifty.com>
Tue, 7 Jul 2015 13:25:05 +0000 (22:25 +0900)
committerkomutan <t_komuta@nifty.com>
Tue, 7 Jul 2015 13:25:05 +0000 (22:25 +0900)
src/LibNMeCab/Core/PriorityQueue.cs

index be3cc43..525e2af 100644 (file)
@@ -11,7 +11,7 @@ namespace NMeCab.Core
         {
             public T Value;
 
-            public LinkedList<Node> Childs = new LinkedList<Node>();
+            public readonly LinkedList<Node> Childs = new LinkedList<Node>();
 
             public Node(T value)
             {
@@ -19,7 +19,7 @@ namespace NMeCab.Core
             }
         }
 
-        private Node rootNode = null;
+        private Node rootNode;
 
         public int Count { get; private set; }
 
@@ -31,12 +31,6 @@ namespace NMeCab.Core
             this.Count = 0;
         }
 
-        public void RemoveFirst()
-        {
-            this.rootNode = this.Unify(this.rootNode.Childs);
-            this.Count--;
-        }
-
         public void Push(T item)
         {
             this.rootNode = this.Merge(this.rootNode, new Node(item));
@@ -50,6 +44,12 @@ namespace NMeCab.Core
             return ret;
         }
 
+        public void RemoveFirst()
+        {
+            this.rootNode = this.Unify(this.rootNode.Childs);
+            this.Count--;
+        }
+
         private Node Merge(Node l, Node r)
         {
             if (l == null) return r;