checkpoint
[sbp.git] / src / edu / berkeley / sbp / util / FastSet.java
index d3be774..bdfa380 100644 (file)
@@ -3,9 +3,9 @@ import java.util.*;
 
 public /*final*/ class FastSet<T> implements Iterator<T>, Iterable<T> {
 
-    public static final int INITIAL_SIZE = 128;
+    public static final int INITIAL_SIZE = 8;
 
-    private       Object[] array;
+    private       Object[] array = null;
     private       T        only  = null;
     private       int      i     = -1;
     private       int      size  = 0;
@@ -39,7 +39,8 @@ public /*final*/ class FastSet<T> implements Iterator<T>, Iterable<T> {
         }
     }
     public void add(T t, boolean check) {
-        if (check) for(Object o : this) if (o.equals(t)) return;
+        //if (check) for(Object o : this) if (o.equals(t)) return;
+        if (check) for(Object o : this) if (o==t) return;
         add(t);
     }
     public void add(T t) {