projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
it all works
[sbp.git]
/
src
/
edu
/
berkeley
/
sbp
/
util
/
FastSet.java
diff --git
a/src/edu/berkeley/sbp/util/FastSet.java
b/src/edu/berkeley/sbp/util/FastSet.java
index
bdfa380
..
b94613e
100644
(file)
--- a/
src/edu/berkeley/sbp/util/FastSet.java
+++ b/
src/edu/berkeley/sbp/util/FastSet.java
@@
-40,7
+40,12
@@
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;
}
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==t) return;
+ if (check) {
+ if (only==t) return;
+ if (array != null)
+ for(int i=0; i<size; i++)
+ if (array[i]==t) return;
+ }
add(t);
}
public void add(T t) {
add(t);
}
public void add(T t) {