lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [4/4] lucenenet git commit: more Equals comparisson fixes
Date Sun, 18 Jan 2015 03:23:19 GMT
more Equals comparisson fixes


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

Branch: refs/heads/master
Commit: a83698970db903b2de2a02548b1946934ffc7220
Parents: dd5e572
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Sat Jan 17 21:41:46 2015 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Sat Jan 17 21:41:46 2015 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/Fst/Builder.cs     | 4 ++--
 src/Lucene.Net.Core/Util/Fst/PairOutputs.cs | 8 ++++----
 src/Lucene.Net.Core/Util/Fst/Util.cs        | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a8369897/src/Lucene.Net.Core/Util/Fst/Builder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Fst/Builder.cs b/src/Lucene.Net.Core/Util/Fst/Builder.cs
index 1012e3a..c92b059 100644
--- a/src/Lucene.Net.Core/Util/Fst/Builder.cs
+++ b/src/Lucene.Net.Core/Util/Fst/Builder.cs
@@ -464,7 +464,7 @@ namespace Lucene.Net.Util.Fst
                 T commonOutputPrefix;
                 T wordSuffix;
 
-                if ((object)lastOutput != (object)NO_OUTPUT)
+                if (!lastOutput.Equals(NO_OUTPUT))
                 {
                     commonOutputPrefix = Fst.Outputs.Common(output, lastOutput);
                     Debug.Assert(ValidOutput(commonOutputPrefix));
@@ -503,7 +503,7 @@ namespace Lucene.Net.Util.Fst
 
         private bool ValidOutput(T output)
         {
-            return (object)output == (object)NO_OUTPUT || !output.Equals(NO_OUTPUT);
+            return output.Equals(NO_OUTPUT) || !output.Equals(NO_OUTPUT);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a8369897/src/Lucene.Net.Core/Util/Fst/PairOutputs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Fst/PairOutputs.cs b/src/Lucene.Net.Core/Util/Fst/PairOutputs.cs
index e1e9565..2e584b5 100644
--- a/src/Lucene.Net.Core/Util/Fst/PairOutputs.cs
+++ b/src/Lucene.Net.Core/Util/Fst/PairOutputs.cs
@@ -91,7 +91,7 @@ namespace Lucene.Net.Util.Fst
                 b = Outputs2.NoOutput;
             }
 
-            if ((object)a == (object)Outputs1.NoOutput && (object)b == (object)Outputs2.NoOutput)
+            if (a.Equals(Outputs1.NoOutput) && b.Equals(Outputs2.NoOutput))
             {
                 return NO_OUTPUT;
             }
@@ -109,19 +109,19 @@ namespace Lucene.Net.Util.Fst
             bool noOutput1 = pair.Output1.Equals(Outputs1.NoOutput);
             bool noOutput2 = pair.Output2.Equals(Outputs2.NoOutput);
 
-            if (noOutput1 && (object)pair.Output1 != (object)Outputs1.NoOutput)
+            if (noOutput1 && !pair.Output1.Equals(Outputs1.NoOutput))
             {
                 return false;
             }
 
-            if (noOutput2 && (object)pair.Output2 != (object)Outputs2.NoOutput)
+            if (noOutput2 && !pair.Output2.Equals(Outputs2.NoOutput))
             {
                 return false;
             }
 
             if (noOutput1 && noOutput2)
             {
-                if (pair != NO_OUTPUT)
+                if (!pair.Equals(NO_OUTPUT))
                 {
                     return false;
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a8369897/src/Lucene.Net.Core/Util/Fst/Util.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Fst/Util.cs b/src/Lucene.Net.Core/Util/Fst/Util.cs
index 0482bb8..a2ff51f 100644
--- a/src/Lucene.Net.Core/Util/Fst/Util.cs
+++ b/src/Lucene.Net.Core/Util/Fst/Util.cs
@@ -780,7 +780,7 @@ namespace Lucene.Net.Util.Fst
                 if (startArc.Final)
                 {
                     isFinal = true;
-                    finalOutput = (object)startArc.NextFinalOutput == (object)NO_OUTPUT ?
default(T) : startArc.NextFinalOutput;
+                    finalOutput = startArc.NextFinalOutput.Equals(NO_OUTPUT) ? default(T)
: startArc.NextFinalOutput;
                 }
                 else
                 {
@@ -848,7 +848,7 @@ namespace Lucene.Net.Util.Fst
                                 }
 
                                 string finalOutput;
-                                if (arc.NextFinalOutput != null && (object)arc.NextFinalOutput
!= (object)NO_OUTPUT)
+                                if (arc.NextFinalOutput != null && !arc.NextFinalOutput.Equals(NO_OUTPUT))
                                 {
                                     finalOutput = fst.Outputs.OutputToString(arc.NextFinalOutput);
                                 }
@@ -866,7 +866,7 @@ namespace Lucene.Net.Util.Fst
                             }
 
                             string outs;
-                            if ((object)arc.Output != (object)NO_OUTPUT)
+                            if (!arc.Output.Equals(NO_OUTPUT))
                             {
                                 outs = "/" + fst.Outputs.OutputToString(arc.Output);
                             }
@@ -875,7 +875,7 @@ namespace Lucene.Net.Util.Fst
                                 outs = "";
                             }
 
-                            if (!FST<T>.TargetHasArcs(arc) && arc.Final &&
(object)arc.NextFinalOutput != (object)NO_OUTPUT)
+                            if (!FST<T>.TargetHasArcs(arc) && arc.Final &&
!arc.NextFinalOutput.Equals(NO_OUTPUT))
                             {
                                 // Tricky special case: sometimes, due to
                                 // pruning, the builder can [sillily] produce


Mime
View raw message