Skip to content

Commit 1b544c5

Browse files
committed
feedback
1 parent 15c147a commit 1b544c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/Microsoft.NET.TestFramework/Utilities/FileThumbPrint.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ public bool Equals(FileThumbPrint? other)
6363

6464
public override int GetHashCode()
6565
{
66-
#if NET
66+
#if NETCOREAPP3_1_OR_GREATER
6767
return HashCode.Combine(Path, LastWriteTimeUtc, Hash);
6868
#else
69-
return Path.GetHashCode() ^ LastWriteTimeUtc.GetHashCode() ^ Hash.GetHashCode();
69+
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;
7074
#endif
7175
}
7276

0 commit comments

Comments
 (0)