Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Avoid allocating in TimeZoneInfo.GetHashCode() (#8513)
Browse files Browse the repository at this point in the history
Avoid the intermediate ToUpper string allocation.
  • Loading branch information
justinvp authored and jkotas committed Dec 8, 2016
1 parent 6d65799 commit bf4ed11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mscorlib/src/System/TimeZoneInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ static public TimeZoneInfo FromSerializedString(string source) {
// GetHashCode -
//
public override int GetHashCode() {
return m_id.ToUpper(CultureInfo.InvariantCulture).GetHashCode();
return StringComparer.OrdinalIgnoreCase.GetHashCode(m_id);
}

//
Expand Down

0 comments on commit bf4ed11

Please sign in to comment.