Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/26/14 16:44:40 (10 years ago)
Author:
bburlacu
Message:

#1772: Fixed a bug where the fragment root would be set to null (the Difference method returned a null value when the compared subtrees were identical).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs

    r11694 r11726  
    4747      var parent = childVertex.Parents.First().Data;
    4848      var subtree = child.Difference(parent);
    49       int index = child.IterateNodesPrefix().TakeWhile(node => node != subtree).Count();
    50       var fragment = new Fragment<ISymbolicExpressionTreeNode> { Root = subtree, Index1 = index, Index2 = index };
     49      Fragment<ISymbolicExpressionTreeNode> fragment = null;
     50      if (subtree != null) {
     51        int index = child.IterateNodesPrefix().TakeWhile(node => node != subtree).Count();
     52        fragment = new Fragment<ISymbolicExpressionTreeNode> { Root = subtree, Index1 = index, Index2 = index };
     53      }
    5154      childVertex.InArcs.Last().Data = fragment;
    5255      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.