Lucene.Net.Core.Util.Automaton: Replaced ValueHashSet with EquatableSet
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/46418a44 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/46418a44 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/46418a44 Branch: refs/heads/api-work Commit: 46418a44901ecc09626db0119cb6a9a64ec48969 Parents: 8801245 Author: Shad Storhaug <[email protected]> Authored: Wed Mar 29 21:36:45 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Thu Mar 30 09:12:30 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Util/Automaton/MinimizationOperations.cs | 8 ++++---- src/Lucene.Net.Core/Util/Automaton/RegExp.cs | 2 +- src/Lucene.Net.Core/Util/Automaton/SpecialOperations.cs | 8 ++++---- .../Util/Automaton/AutomatonTestUtil.cs | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/46418a44/src/Lucene.Net.Core/Util/Automaton/MinimizationOperations.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Util/Automaton/MinimizationOperations.cs b/src/Lucene.Net.Core/Util/Automaton/MinimizationOperations.cs index 1350478..579845f 100644 --- a/src/Lucene.Net.Core/Util/Automaton/MinimizationOperations.cs +++ b/src/Lucene.Net.Core/Util/Automaton/MinimizationOperations.cs @@ -81,7 +81,7 @@ namespace Lucene.Net.Util.Automaton State[] states = a.GetNumberedStates(); int sigmaLen = sigma.Length, statesLen = states.Length; List<State>[,] reverse = new List<State>[statesLen, sigmaLen]; - HashSet<State>[] partition = new ValueHashSet<State>[statesLen]; + ISet<State>[] partition = new EquatableSet<State>[statesLen]; List<State>[] splitblock = new List<State>[statesLen]; int[] block = new int[statesLen]; StateList[,] active = new StateList[statesLen, sigmaLen]; @@ -92,7 +92,7 @@ namespace Lucene.Net.Util.Automaton for (int q = 0; q < statesLen; q++) { splitblock[q] = new List<State>(); - partition[q] = new ValueHashSet<State>(); + partition[q] = new EquatableSet<State>(); for (int x = 0; x < sigmaLen; x++) { active[q, x] = new StateList(); @@ -175,8 +175,8 @@ namespace Lucene.Net.Util.Automaton List<State> sb = splitblock[j]; if (sb.Count < partition[j].Count) { - HashSet<State> b1 = partition[j]; - HashSet<State> b2 = partition[k]; + ISet<State> b1 = partition[j]; + ISet<State> b2 = partition[k]; foreach (State s in sb) { b1.Remove(s); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/46418a44/src/Lucene.Net.Core/Util/Automaton/RegExp.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Util/Automaton/RegExp.cs b/src/Lucene.Net.Core/Util/Automaton/RegExp.cs index 87be9eb..1bfe383 100644 --- a/src/Lucene.Net.Core/Util/Automaton/RegExp.cs +++ b/src/Lucene.Net.Core/Util/Automaton/RegExp.cs @@ -758,7 +758,7 @@ namespace Lucene.Net.Util.Automaton /// </summary> public virtual ISet<string> GetIdentifiers() { - HashSet<string> set = new ValueHashSet<string>(); + ISet<string> set = new EquatableSet<string>(); GetIdentifiers(set); return set; } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/46418a44/src/Lucene.Net.Core/Util/Automaton/SpecialOperations.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Util/Automaton/SpecialOperations.cs b/src/Lucene.Net.Core/Util/Automaton/SpecialOperations.cs index 8fad6e6..7dfffe9 100644 --- a/src/Lucene.Net.Core/Util/Automaton/SpecialOperations.cs +++ b/src/Lucene.Net.Core/Util/Automaton/SpecialOperations.cs @@ -236,9 +236,9 @@ namespace Lucene.Net.Util.Automaton { a.ExpandSingleton(); // reverse all edges - Dictionary<State, HashSet<Transition>> m = new Dictionary<State, HashSet<Transition>>(); + Dictionary<State, ISet<Transition>> m = new Dictionary<State, ISet<Transition>>(); State[] states = a.GetNumberedStates(); - HashSet<State> accept = new ValueHashSet<State>(); + ISet<State> accept = new EquatableSet<State>(); foreach (State s in states) { if (s.Accept) @@ -248,7 +248,7 @@ namespace Lucene.Net.Util.Automaton } foreach (State r in states) { - m[r] = new ValueHashSet<Transition>(); + m[r] = new EquatableSet<Transition>(); r.accept = false; } foreach (State r in states) @@ -260,7 +260,7 @@ namespace Lucene.Net.Util.Automaton } foreach (State r in states) { - HashSet<Transition> tr = m[r]; + ISet<Transition> tr = m[r]; r.SetTransitions(tr.ToArray(/*new Transition[tr.Count]*/)); } // make new initial+final states http://git-wip-us.apache.org/repos/asf/lucenenet/blob/46418a44/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs b/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs index 47385b3..6440283 100644 --- a/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs +++ b/src/Lucene.Net.TestFramework/Util/Automaton/AutomatonTestUtil.cs @@ -455,7 +455,7 @@ namespace Lucene.Net.Util.Automaton { return; } - HashSet<State> initialset = new ValueHashSet<State>(); + ISet<State> initialset = new EquatableSet<State>(); initialset.Add(a.initial); DeterminizeSimple(a, initialset); } @@ -490,7 +490,7 @@ namespace Lucene.Net.Util.Automaton } for (int n = 0; n < points.Length; n++) { - ISet<State> p = new ValueHashSet<State>(); + ISet<State> p = new EquatableSet<State>(); foreach (State q in s) { foreach (Transition t in q.GetTransitions())
