Lucene.Net.Queries.Function.ValueSources.VectorValueSource: Use 
Equatable.Wrap() to wrap the provided list in EquatableList for Equals() and 
GetHashCode() comparisons


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

Branch: refs/heads/api-work
Commit: ebfca98baf213971875cc190fae0a832c0297ea2
Parents: c0a9ae6
Author: Shad Storhaug <[email protected]>
Authored: Thu Mar 30 08:39:30 2017 +0700
Committer: Shad Storhaug <[email protected]>
Committed: Thu Mar 30 09:12:33 2017 +0700

----------------------------------------------------------------------
 .../Function/ValueSources/VectorValueSource.cs            | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ebfca98b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs 
b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
index 90850d2..7cb5c58 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Index;
 using Lucene.Net.Search;
+using Lucene.Net.Support;
 using System.Collections;
 using System.Collections.Generic;
 using System.Text;
@@ -290,12 +291,17 @@ namespace Lucene.Net.Queries.Function.ValueSources
             }
 
             var that = (VectorValueSource)o;
-            return m_sources.Equals(that.m_sources);
+
+            // LUCENENET specific: ensure our passed in list is equatable by
+            // wrapping it in an EquatableList if it is not one already
+            return Equatable.Wrap(m_sources).Equals(that.m_sources);
         }
 
         public override int GetHashCode()
         {
-            return m_sources.GetHashCode();
+            // LUCENENET specific: ensure our passed in list is equatable by
+            // wrapping it in an EquatableList if it is not one already
+            return Equatable.Wrap(m_sources).GetHashCode();
         }
     }
 }
\ No newline at end of file

Reply via email to