diff --git a/VectoCore/Utils/SI.cs b/VectoCore/Utils/SI.cs index cfcb7d3b3d7811d3e47516f0cc3587fadf2599e7..f4f772d28f6e0fd870f76572ba0507d6670ad3bc 100644 --- a/VectoCore/Utils/SI.cs +++ b/VectoCore/Utils/SI.cs @@ -1627,16 +1627,15 @@ namespace TUGraz.VectoCore.Utils [DebuggerHidden] public bool HasEqualUnit(SI si) { - return true; - //Contract.Requires(si != null); - //if (Numerator.SequenceEqual(si.Numerator) && Denominator.SequenceEqual(si.Denominator)) { - // return true; - //} - //return ToBasicUnits() - // .Denominator.OrderBy(x => x) - // .SequenceEqual(si.ToBasicUnits().Denominator.OrderBy(x => x)) - // && - // ToBasicUnits().Numerator.OrderBy(x => x).SequenceEqual(si.ToBasicUnits().Numerator.OrderBy(x => x)); + Contract.Requires(si != null); + if (Numerator.SequenceEqual(si.Numerator) && Denominator.SequenceEqual(si.Denominator)) { + return true; + } + return ToBasicUnits() + .Denominator.OrderBy(x => x) + .SequenceEqual(si.ToBasicUnits().Denominator.OrderBy(x => x)) + && + ToBasicUnits().Numerator.OrderBy(x => x).SequenceEqual(si.ToBasicUnits().Numerator.OrderBy(x => x)); } /// <summary>