lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/4] lucenenet git commit: Bringing code to be inline with the Java version
Date Wed, 08 Apr 2015 17:01:00 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 464fd5054 -> 31a43f02a


Bringing code to be inline with the Java version

Source: https://github.com/apache/lucene-solr/blob/lucene_solr_4_8_0/lucene/core/src/java/org/apache/lucene/util/fst/NodeHash.java


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

Branch: refs/heads/master
Commit: ea7cfe6972972f91090d995c729689fff9a0f54c
Parents: 464fd50
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Wed Apr 8 19:59:53 2015 +0300
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Wed Apr 8 19:59:53 2015 +0300

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


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea7cfe69/src/Lucene.Net.Core/Util/Fst/NodeHash.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Fst/NodeHash.cs b/src/Lucene.Net.Core/Util/Fst/NodeHash.cs
index d4ff9e7..4e8bc73 100644
--- a/src/Lucene.Net.Core/Util/Fst/NodeHash.cs
+++ b/src/Lucene.Net.Core/Util/Fst/NodeHash.cs
@@ -85,11 +85,9 @@ namespace Lucene.Net.Util.Fst
                 Builder<T>.Arc<T> arc = node.Arcs[arcIdx];
                 h = PRIME * h + arc.Label;
                 long n = ((Builder<T>.CompiledNode)arc.Target).Node;
-                h = PRIME * h + (int)((n ^ (n >> 32)) >> 32);
-                var arcOutputHashCode = arc.Output.GetHashCode();
-                h = PRIME * h + arcOutputHashCode;
-                var arcFinalOutputHashCode = arc.NextFinalOutput.GetHashCode();
-                h = PRIME * h + arcFinalOutputHashCode;
+                h = PRIME * h + (int)(n ^ (n >> 32));
+                h = PRIME * h + arc.Output.GetHashCode();
+                h = PRIME * h + arc.NextFinalOutput.GetHashCode();
                 if (arc.IsFinal)
                 {
                     h += 17;
@@ -110,12 +108,9 @@ namespace Lucene.Net.Util.Fst
             {
                 //System.out.println("  label=" + scratchArc.label + " target=" + scratchArc.target
+ " h=" + h + " output=" + fst.outputs.outputToString(scratchArc.output) + " next?=" + scratchArc.flag(4)
+ " final?=" + scratchArc.isFinal() + " pos=" + in.getPosition());
                 h = PRIME * h + ScratchArc.Label;
-                //Force truncation by shifting at the end
-                h = PRIME * h + (int)((ScratchArc.Target ^ (ScratchArc.Target >> 32))
>> 32);
-                var sractchArcHashCode = ScratchArc.Output.GetHashCode();
-                h = PRIME * h + sractchArcHashCode;
-                var scratchArcFinalOutputHashCode = ScratchArc.NextFinalOutput.GetHashCode();
-                h = PRIME * h + scratchArcFinalOutputHashCode;
+                h = PRIME * h + (int)(ScratchArc.Target ^ (ScratchArc.Target >> 32));
+                h = PRIME * h + ScratchArc.Output.GetHashCode();
+                h = PRIME * h + ScratchArc.NextFinalOutput.GetHashCode();
                 if (ScratchArc.Final)
                 {
                     h += 17;


Mime
View raw message