Lucene.Net.Core.Search.Spans.SpanNearQuery: Replaced ValueList<T> with Equatable.Wrap(), which allows any type of list to be utilized
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/3489bd19 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/3489bd19 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/3489bd19 Branch: refs/heads/api-work Commit: 3489bd19d432d0f1bb939644421ac78def1085e8 Parents: 476b289 Author: Shad Storhaug <[email protected]> Authored: Wed Mar 29 20:20:24 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Thu Mar 30 09:12:28 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3489bd19/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs b/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs index 8de90aa..00b038a 100644 --- a/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs +++ b/src/Lucene.Net.Core/Search/Spans/SpanNearQuery.cs @@ -37,9 +37,7 @@ namespace Lucene.Net.Search.Spans /// </summary> public class SpanNearQuery : SpanQuery { - // LUCENENET NOTE: The hash code needs to be made from the hash codes of all elements. - // So, we force all subclasses to use ValueList<SpanQuery> instead of IList<SpanQuery> to ensure that logic is in place. - protected readonly ValueList<SpanQuery> m_clauses; + protected readonly IList<SpanQuery> m_clauses; protected int m_slop; protected bool m_inOrder; @@ -228,7 +226,7 @@ namespace Lucene.Net.Search.Spans { return false; } - if (!m_clauses.SequenceEqual(spanNearQuery.m_clauses)) + if (!Equatable.Wrap(m_clauses).Equals(spanNearQuery.m_clauses)) { return false; } @@ -239,7 +237,7 @@ namespace Lucene.Net.Search.Spans public override int GetHashCode() { int result; - result = m_clauses.GetHashCode(); + result = Equatable.Wrap(m_clauses).GetHashCode(); // Mix bits before folding in things like boost, since it could cancel the // last element of clauses. this particular mix also serves to // differentiate SpanNearQuery hashcodes from others.
