projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint
[sbp.git]
/
src
/
edu
/
berkeley
/
sbp
/
Forest.java
diff --git
a/src/edu/berkeley/sbp/Forest.java
b/src/edu/berkeley/sbp/Forest.java
index
ed1c9ac
..
6ac1e4b
100644
(file)
--- a/
src/edu/berkeley/sbp/Forest.java
+++ b/
src/edu/berkeley/sbp/Forest.java
@@
-144,7
+144,7
@@
public abstract class Forest<T> {
}
public Iterator<Body<T>> iterator() { return ((IterableForest<T>)resolve()).iterator(); }
public HashSet<Tree<T>> expand(boolean toss) { return resolve().expand(toss); }
}
public Iterator<Body<T>> iterator() { return ((IterableForest<T>)resolve()).iterator(); }
public HashSet<Tree<T>> expand(boolean toss) { return resolve().expand(toss); }
- public boolean valid() { resolve(); return valid; }
+ public boolean valid() { if (valid) return true; resolve(); return valid; }
public String toString() { return resolve().toString(); }
public Forest resolve() {
if (hp==null) return res;
public String toString() { return resolve().toString(); }
public Forest resolve() {
if (hp==null) return res;
@@
-156,11
+156,13
@@
public abstract class Forest<T> {
else results = new HashSet<Body>();
}
if (results != null) {
else results = new HashSet<Body>();
}
if (results != null) {
- for(Forest<?> p : hp) for(Body<?> b : (IterableForest<?>)p) results.add(b);
+ for(Forest<?> p : hp)
+ for(Body<?> b : (IterableForest<?>)p)
+ results.add(b);
for(Body b : results) {
if (b.keep() && (b.creator==null || !b.creator.lame)) continue;
for(Body b : results) {
if (b.keep() && (b.creator==null || !b.creator.lame)) continue;
- if (!b.keep(results)) continue;
if (b.creator!=null && b.creator.lame) continue;
if (b.creator!=null && b.creator.lame) continue;
+ if (!b.keep(results)) continue;
valid = true;
b.addTo(nh);
}
valid = true;
b.addTo(nh);
}