Revision: 10707
http://foray.svn.sourceforge.net/foray/?rev=10707&view=rev
Author: victormote
Date: 2009-03-17 17:43:11 +0000 (Tue, 17 Mar 2009)
Log Message:
-----------
Simplify logic and make it less dependent on the len parameter.
Modified Paths:
--------------
trunk/foray/foray-common/src/java/org/foray/common/TernaryTreeMap.java
Modified: trunk/foray/foray-common/src/java/org/foray/common/TernaryTreeMap.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/TernaryTreeMap.java 2009-03-17 17:39:50 UTC (rev 10706)
+++ trunk/foray/foray-common/src/java/org/foray/common/TernaryTreeMap.java 2009-03-17 17:43:11 UTC (rev 10707)
@@ -326,6 +326,7 @@
this.lo[newNodeIndex] = this.lo[currentNodeIndex];
this.eq[newNodeIndex] = this.eq[currentNodeIndex];
this.lo[currentNodeIndex] = 0;
+ this.keyChar[newNodeIndex] = Character.MAX_VALUE;
if (len > 0) {
/* Recompress what is left of the compressed node. */
/* Set the key character for this node to be the first character in the previously-compressed data. */
@@ -341,13 +342,9 @@
this.lo[newNodeIndex] = 0;
this.keyChar[newNodeIndex] = 0;
this.hi[newNodeIndex] = 0;
- } else {
- /* The compressed node is not empty. Mark the new node to indicate that it IS a compressed node. */
- this.keyChar[newNodeIndex] = Character.MAX_VALUE;
}
} else {
/* Length is zero, so we are at the end of the String being added. */
- this.keyChar[newNodeIndex] = Character.MAX_VALUE;
this.hi[currentNodeIndex] = newNodeIndex;
this.length++;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|