checkpoint
[sbp.git] / src / edu / berkeley / sbp / Tree.java
index 7dbda47..1b9ddfa 100644 (file)
@@ -48,10 +48,7 @@ public class Tree<T>
         this.location = loc;
         this.head = head;
         this.lift = lift && children != null && children.length > 0;
-
-        Tree<T>[] children2 = children==null ? new Tree[0] : new Tree[children.length];
-        if (children != null) System.arraycopy(children, 0, children2, 0, children.length);
-        this.children = children2;
+        this.children = ArrayUtil.clone(children, Tree.class);
     }
 
 
@@ -86,6 +83,9 @@ public class Tree<T>
     public boolean isTransparent() { return false; }
     public boolean isHidden() { return false; }
 
+
+    // TreeFunctor /////////////////////////////////////////////////////////////////////////////
+
     public static interface TreeFunctor<T,R> extends Functor<Iterable<Tree<T>>, R> { }
     
 }