Optimize Uri.GetHashCode (#32713)
authorMiha Zupan <mihazupan.zupan1@gmail.com>
Wed, 29 Apr 2020 17:50:15 +0000 (19:50 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Apr 2020 17:50:15 +0000 (19:50 +0200)
commitb4b2c4653a232b87bdc34b8185b94545fbe4de80
tree0c1c90c5e9460da26613e82a77d3278e891635f9
parent0fa0b905f65e57f5eb64dd556a07ead522930c8a
Optimize Uri.GetHashCode (#32713)

* Optimize Uri.GetHashCode

* Don't use case-insensitive string hashing when not necessary

* Don't expect Uri.GetHashCode to always be case-insensitive in tests

* Correct Uri.Equals test

Hash codes being equal doesn't mean that the values are equal

* Do not cache Uri GetHashCode

* Simplify Uri.Equals test
src/libraries/System.Private.Uri/src/System/Uri.cs
src/libraries/System.Runtime/tests/System/Uri.MethodsTests.cs