From 311d013bccddd0417a9ed293c90e8034df4d159c Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Thu, 8 Dec 2016 13:21:43 -0800 Subject: [PATCH] Avoid allocating in TimeZoneInfo.GetHashCode() (dotnet/coreclr#8513) Avoid the intermediate ToUpper string allocation. Commit migrated from https://github.com/dotnet/coreclr/commit/bf4ed11eb5cee7123fd0c6fa5b60f09fe7adf23e --- src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs b/src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs index 5000206..d8662d4 100644 --- a/src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs +++ b/src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs @@ -969,7 +969,7 @@ namespace System { // GetHashCode - // public override int GetHashCode() { - return m_id.ToUpper(CultureInfo.InvariantCulture).GetHashCode(); + return StringComparer.OrdinalIgnoreCase.GetHashCode(m_id); } // -- 2.7.4