We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15c147a commit 1b544c5Copy full SHA for 1b544c5
test/Microsoft.NET.TestFramework/Utilities/FileThumbPrint.cs
@@ -63,10 +63,14 @@ public bool Equals(FileThumbPrint? other)
63
64
public override int GetHashCode()
65
{
66
-#if NET
+#if NETCOREAPP3_1_OR_GREATER
67
return HashCode.Combine(Path, LastWriteTimeUtc, Hash);
68
#else
69
- return Path.GetHashCode() ^ LastWriteTimeUtc.GetHashCode() ^ Hash.GetHashCode();
+ int hashCode = 1601069575;
70
+ hashCode = hashCode * -1521134295 + EqualityComparer<string?>.Default.GetHashCode(Path);
71
+ hashCode = hashCode * -1521134295 + EqualityComparer<DateTime?>.Default.GetHashCode(LastWriteTimeUtc);
72
+ hashCode = hashCode * -1521134295 + EqualityComparer<string?>.Default.GetHashCode(Hash);
73
+ return hashCode;
74
#endif
75
}
76
0 commit comments