From: komutan Date: Tue, 7 Jul 2015 13:25:05 +0000 (+0900) Subject: 微修正 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=aa1dbab6dd47265f46cdb535f7b51c4b5b85e96b;p=nmecab%2FNMeCabRepo2.git 微修正 --- diff --git a/src/LibNMeCab/Core/PriorityQueue.cs b/src/LibNMeCab/Core/PriorityQueue.cs index be3cc43..525e2af 100644 --- a/src/LibNMeCab/Core/PriorityQueue.cs +++ b/src/LibNMeCab/Core/PriorityQueue.cs @@ -11,7 +11,7 @@ namespace NMeCab.Core { public T Value; - public LinkedList Childs = new LinkedList(); + public readonly LinkedList Childs = new LinkedList(); 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;