summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-21 16:27:30 +0000
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-21 16:27:30 +0000
commitde6677cbe3d661c01e25c5f6d12721cadc4e9acf (patch)
tree34ee06dfebce45b5fc103b9e05a377e45500d78b
parent79f25e9a22ef1511e71ffa74fa62658cf72b1029 (diff)
downloadgcc-de6677cbe3d661c01e25c5f6d12721cadc4e9acf.tar.gz
2004-09-21 Mark Wielaard <mark@klomp.org>
* java/util/TreeMap.java (root): Don't initialize. (TreeMap(Comparator)): Call fabricateTree(0). (fabricateTree): Initialize root and size when count is 0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87811 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/java/util/TreeMap.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/libjava/java/util/TreeMap.java b/libjava/java/util/TreeMap.java
index d3b67481511..5272bc17301 100644
--- a/libjava/java/util/TreeMap.java
+++ b/libjava/java/util/TreeMap.java
@@ -130,7 +130,7 @@ public class TreeMap extends AbstractMap
/**
* The root node of this TreeMap.
*/
- private transient Node root = nil;
+ private transient Node root;
/**
* The size of this TreeMap. Package visible for use by nested classes.
@@ -213,6 +213,7 @@ public class TreeMap extends AbstractMap
public TreeMap(Comparator c)
{
comparator = c;
+ fabricateTree(0);
}
/**
@@ -851,7 +852,11 @@ public class TreeMap extends AbstractMap
private void fabricateTree(final int count)
{
if (count == 0)
- return;
+ {
+ root = nil;
+ size = 0;
+ return;
+ }
// We color every row of nodes black, except for the overflow nodes.
// I believe that this is the optimal arrangement. We construct the tree