lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/5] lucenenet git commit: Fix Term.CompareTo() to use Ordinal for the field name. This matches what Java does as a default.
Date Wed, 18 Feb 2015 04:24:03 GMT
Fix Term.CompareTo() to use Ordinal for the field name. This matches what Java does as a default.


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

Branch: refs/heads/master
Commit: ff91e96e15d8b3adc2543ec292dff72559d31f4d
Parents: f1a2b50
Author: Chand2048 <Chand@Microsoft.com>
Authored: Tue Feb 17 14:33:51 2015 -0800
Committer: Chand2048 <Chand@Microsoft.com>
Committed: Tue Feb 17 14:33:51 2015 -0800

----------------------------------------------------------------------
 src/Lucene.Net.Core/Index/Term.cs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ff91e96e/src/Lucene.Net.Core/Index/Term.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/Term.cs b/src/Lucene.Net.Core/Index/Term.cs
index a95b4c6..cc9b1c5 100644
--- a/src/Lucene.Net.Core/Index/Term.cs
+++ b/src/Lucene.Net.Core/Index/Term.cs
@@ -149,13 +149,14 @@ namespace Lucene.Net.Index
         /// </summary>
         public int CompareTo(Term other)
         {
-            if (Field_Renamed.Equals(other.Field_Renamed))
+            int compare = string.Compare(Field_Renamed, other.Field_Renamed, StringComparison.Ordinal);
+            if (compare == 0)
             {
                 return Bytes_Renamed.CompareTo(other.Bytes_Renamed);
             }
             else
             {
-                return Field_Renamed.CompareTo(other.Field_Renamed);
+                return compare;
             }
         }
 


Mime
View raw message