public bool Equals(RuntimeDescription other) { return(other != null && string.Equals(other.RuntimeIdentifier, RuntimeIdentifier, StringComparison.Ordinal) && InheritedRuntimes.OrderBy(s => s).SequenceEqual(other.InheritedRuntimes.OrderBy(s => s)) && RuntimeDependencySets.OrderBy(p => p.Key).SequenceEqual(other.RuntimeDependencySets.OrderBy(p => p.Key))); }
public bool Equals(RuntimeDescription other) { // Breaking this up to ease debugging. The optimizer should be able to handle this, so don't refactor unless you have data :). if (other == null) { return(false); } return(string.Equals(other.RuntimeIdentifier, RuntimeIdentifier, StringComparison.Ordinal) && InheritedRuntimes.OrderedEquals(other.InheritedRuntimes, s => s, StringComparer.Ordinal, StringComparer.Ordinal) && RuntimeDependencySets.OrderedEquals(other.RuntimeDependencySets, p => p.Key, StringComparer.Ordinal)); }
public bool Equals(RuntimeDescription other) { if (ReferenceEquals(this, other)) { return(true); } if (other == null) { return(false); } return(string.Equals(other.RuntimeIdentifier, RuntimeIdentifier, StringComparison.Ordinal) && InheritedRuntimes.OrderedEquals(other.InheritedRuntimes, s => s, StringComparer.Ordinal, StringComparer.Ordinal) && RuntimeDependencySets.OrderedEquals(other.RuntimeDependencySets, p => p.Key, StringComparer.OrdinalIgnoreCase)); }