Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12663


Ignore:
Timestamp:
07/07/15 18:16:55 (9 years ago)
Author:
gkronber
Message:

#2261: fix of broken Equals implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs

    r12658 r12663  
    6262          var other = (TreeNode)obj;
    6363          return Val.Equals(other.Val) &&
    64             VarName.Equals(other.VarName) &&
    6564            LeftIdx.Equals(other.LeftIdx) &&
    66             RightIdx.Equals(other.RightIdx);
     65            RightIdx.Equals(other.RightIdx) &&
     66            EqualStrings(VarName, other.VarName);
    6767        } else {
    6868          return false;
    6969        }
     70      }
     71
     72      private bool EqualStrings(string a, string b) {
     73        return (a == null && b == null) ||
     74               (a != null && b != null && a.Equals(b));
    7075      }
    7176    }
Note: See TracChangeset for help on using the changeset viewer.