Changeset 17590 for branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs
- Timestamp:
- 06/08/20 14:03:32 (4 years ago)
- Location:
- branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs
r17180 r17590 64 64 } 65 65 66 private class Symbol NameComparer : IEqualityComparer<ISymbol>, IComparer<ISymbol> {66 private class SymbolComparer : IEqualityComparer<ISymbol>, IComparer<ISymbol> { 67 67 public int Compare(ISymbol x, ISymbol y) { 68 68 return x.Name.CompareTo(y.Name); … … 70 70 71 71 public bool Equals(ISymbol x, ISymbol y) { 72 return Compare(x, y) == 0;72 return x.GetType() == y.GetType(); 73 73 } 74 74 75 75 public int GetHashCode(ISymbol obj) { 76 return obj. Name.GetHashCode();76 return obj.GetType().GetHashCode(); 77 77 } 78 78 } … … 80 80 // the lookup table is also used in the corresponding formatter 81 81 internal static readonly BidirectionalLookup<string, ISymbol> 82 knownSymbols = new BidirectionalLookup<string, ISymbol>(StringComparer.InvariantCulture, new Symbol NameComparer());82 knownSymbols = new BidirectionalLookup<string, ISymbol>(StringComparer.InvariantCulture, new SymbolComparer()); 83 83 84 84 private Constant constant = new Constant();
Note: See TracChangeset
for help on using the changeset viewer.