Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary CultureInfo.CurrentCulture accesses in Enum #38866

Merged
merged 2 commits into from
Jul 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/libraries/System.Private.CoreLib/src/System/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,67 +1032,67 @@ public TypeCode GetTypeCode()

bool IConvertible.ToBoolean(IFormatProvider? provider)
{
return Convert.ToBoolean(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToBoolean(GetValue());
}

char IConvertible.ToChar(IFormatProvider? provider)
{
return Convert.ToChar(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToChar(GetValue());
}

sbyte IConvertible.ToSByte(IFormatProvider? provider)
{
return Convert.ToSByte(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToSByte(GetValue());
}

byte IConvertible.ToByte(IFormatProvider? provider)
{
return Convert.ToByte(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToByte(GetValue());
}

short IConvertible.ToInt16(IFormatProvider? provider)
{
return Convert.ToInt16(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToInt16(GetValue());
}

ushort IConvertible.ToUInt16(IFormatProvider? provider)
{
return Convert.ToUInt16(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToUInt16(GetValue());
}

int IConvertible.ToInt32(IFormatProvider? provider)
{
return Convert.ToInt32(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToInt32(GetValue());
}

uint IConvertible.ToUInt32(IFormatProvider? provider)
{
return Convert.ToUInt32(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToUInt32(GetValue());
}

long IConvertible.ToInt64(IFormatProvider? provider)
{
return Convert.ToInt64(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToInt64(GetValue());
}

ulong IConvertible.ToUInt64(IFormatProvider? provider)
{
return Convert.ToUInt64(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToUInt64(GetValue());
}

float IConvertible.ToSingle(IFormatProvider? provider)
{
return Convert.ToSingle(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToSingle(GetValue());
}

double IConvertible.ToDouble(IFormatProvider? provider)
{
return Convert.ToDouble(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToDouble(GetValue());
}

decimal IConvertible.ToDecimal(IFormatProvider? provider)
{
return Convert.ToDecimal(GetValue(), CultureInfo.CurrentCulture);
return Convert.ToDecimal(GetValue());
}

DateTime IConvertible.ToDateTime(IFormatProvider? provider)
Expand Down