lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/4] lucenenet git commit: use Equals instead of cast to object
Date Sun, 18 Jan 2015 03:23:17 GMT
use Equals instead of cast to object


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

Branch: refs/heads/master
Commit: 580df448724d68db306dcb28c7a113ce7425d672
Parents: 9b7cd19
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Sat Jan 17 21:13:34 2015 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Sat Jan 17 21:13:34 2015 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/Fst/FST.cs | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/580df448/src/Lucene.Net.Core/Util/Fst/FST.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Fst/FST.cs b/src/Lucene.Net.Core/Util/Fst/FST.cs
index f01f91a..0e6e29b 100644
--- a/src/Lucene.Net.Core/Util/Fst/FST.cs
+++ b/src/Lucene.Net.Core/Util/Fst/FST.cs
@@ -715,14 +715,14 @@ namespace Lucene.Net.Util.Fst
                 if (arc.IsFinal)
                 {
                     flags += BIT_FINAL_ARC;
-                    if ((object)arc.NextFinalOutput != (object)NO_OUTPUT)
+                    if (!arc.NextFinalOutput.Equals(NO_OUTPUT))
                     {
                         flags += BIT_ARC_HAS_FINAL_OUTPUT;
                     }
                 }
                 else
                 {
-                    Debug.Assert((object)arc.NextFinalOutput == (object)NO_OUTPUT);
+                    Debug.Assert(arc.NextFinalOutput.Equals(NO_OUTPUT));
                 }
 
                 bool targetHasArcs = target.Node > 0;
@@ -736,7 +736,7 @@ namespace Lucene.Net.Util.Fst
                     InCounts.Set((int)target.Node, InCounts.Get((int)target.Node) + 1);
                 }
 
-                if ((object)arc.Output != (object)NO_OUTPUT)
+                if (!arc.Output.Equals(NO_OUTPUT))
                 {
                     flags += BIT_ARC_HAS_OUTPUT;
                 }
@@ -746,14 +746,14 @@ namespace Lucene.Net.Util.Fst
 
                 // System.out.println("  write arc: label=" + (char) arc.Label + " flags="
+ flags + " target=" + target.Node + " pos=" + bytes.getPosition() + " output=" + outputs.outputToString(arc.Output));
 
-                if ((object)arc.Output != (object)NO_OUTPUT)
+                if (!arc.Output.Equals(NO_OUTPUT))
                 {
                     Outputs.Write(arc.Output, Bytes);
                     //System.out.println("    write output");
                     arcWithOutputCount++;
                 }
 
-                if ((object)arc.NextFinalOutput != (object)NO_OUTPUT)
+                if (!arc.NextFinalOutput.Equals(NO_OUTPUT))
                 {
                     //System.out.println("    write final output");
                     Outputs.WriteFinalOutput(arc.NextFinalOutput, Bytes);
@@ -888,7 +888,7 @@ namespace Lucene.Net.Util.Fst
             {
                 arc.Flags = (sbyte)(BIT_FINAL_ARC | BIT_LAST_ARC);
                 arc.NextFinalOutput = emptyOutput;
-                if ((object)emptyOutput != (object)NO_OUTPUT)
+                if (!emptyOutput.Equals(NO_OUTPUT))
                 {
                     arc.Flags |= (sbyte)BIT_ARC_HAS_FINAL_OUTPUT;
                 }
@@ -1878,21 +1878,21 @@ namespace Lucene.Net.Util.Fst
                             if (arc.Final)
                             {
                                 flags += (sbyte)BIT_FINAL_ARC;
-                                if ((object)arc.NextFinalOutput != (object)NO_OUTPUT)
+                                if (!arc.NextFinalOutput.Equals(NO_OUTPUT))
                                 {
                                     flags += (sbyte)BIT_ARC_HAS_FINAL_OUTPUT;
                                 }
                             }
                             else
                             {
-                                Debug.Assert((object)arc.NextFinalOutput == (object)NO_OUTPUT);
+                                Debug.Assert(arc.NextFinalOutput.Equals(NO_OUTPUT));
                             }
                             if (!TargetHasArcs(arc))
                             {
                                 flags += (sbyte)BIT_STOP_NODE;
                             }
 
-                            if ((object)arc.Output != (object)NO_OUTPUT)
+                            if (!arc.Output.Equals(NO_OUTPUT))
                             {
                                 flags += (sbyte)BIT_ARC_HAS_OUTPUT;
                             }
@@ -1934,7 +1934,7 @@ namespace Lucene.Net.Util.Fst
 
                             fst.WriteLabel(writer, arc.Label);
 
-                            if ((object)arc.Output != (object)NO_OUTPUT)
+                            if (!arc.Output.Equals(NO_OUTPUT))
                             {
                                 Outputs.Write(arc.Output, writer);
                                 if (!retry)
@@ -1942,7 +1942,7 @@ namespace Lucene.Net.Util.Fst
                                     fst.arcWithOutputCount++;
                                 }
                             }
-                            if ((object)arc.NextFinalOutput != (object)NO_OUTPUT)
+                            if (!arc.NextFinalOutput.Equals(NO_OUTPUT))
                             {
                                 Outputs.WriteFinalOutput(arc.NextFinalOutput, writer);
                             }


Mime
View raw message