Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/30/11 17:48:18 (11 years ago)
Author:
mkommend
Message:

#1579: Changed cloning of SymbolicExpressionTreeNodes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs

    r6375 r6684  
    5555      : base() {
    5656      symbol = original.symbol; // symbols are reused
    57       subtrees = new List<ISymbolicExpressionTreeNode>(original.subtrees.Count);
    58       foreach (var subtree in original.subtrees) {
    59         var clonedSubtree = cloner.Clone(subtree);
    60         subtrees.Add(clonedSubtree);
    61         clonedSubtree.Parent = this;
     57      if (original.subtrees != null) {
     58        subtrees = new List<ISymbolicExpressionTreeNode>(original.subtrees.Count);
     59        foreach (var subtree in original.subtrees) {
     60          var clonedSubtree = cloner.Clone(subtree);
     61          subtrees.Add(clonedSubtree);
     62          clonedSubtree.Parent = this;
     63        }
    6264      }
    6365    }
Note: See TracChangeset for help on using the changeset viewer.