diff options
author | Stephen Toub <stoub@microsoft.com> | 2018-03-04 15:55:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-04 15:55:34 -0500 |
commit | 6613ec75c251dfff265e0f8bfc5d453bdf0e48e7 (patch) | |
tree | e960670016c632159e3af5baae9d8d9cb875950e /src | |
parent | aaafa705f6aa930343061a0753928839b1e75bf2 (diff) | |
download | coreclr-6613ec75c251dfff265e0f8bfc5d453bdf0e48e7.tar.gz coreclr-6613ec75c251dfff265e0f8bfc5d453bdf0e48e7.tar.bz2 coreclr-6613ec75c251dfff265e0f8bfc5d453bdf0e48e7.zip |
Delete stale TryFormat and {Try}Parse overloads (#16746)
Diffstat (limited to 'src')
-rw-r--r-- | src/mscorlib/shared/System/Byte.cs | 4 | ||||
-rw-r--r-- | src/mscorlib/shared/System/DateTime.cs | 23 | ||||
-rw-r--r-- | src/mscorlib/shared/System/DateTimeOffset.cs | 23 |
3 files changed, 0 insertions, 50 deletions
diff --git a/src/mscorlib/shared/System/Byte.cs b/src/mscorlib/shared/System/Byte.cs index 13ceb7573d..31185f0ed0 100644 --- a/src/mscorlib/shared/System/Byte.cs +++ b/src/mscorlib/shared/System/Byte.cs @@ -192,10 +192,6 @@ namespace System return Number.FormatInt32(m_value, format, provider); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) => - TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider); - public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider provider = null) { return Number.TryFormatInt32(m_value, format, provider, destination, out charsWritten); diff --git a/src/mscorlib/shared/System/DateTime.cs b/src/mscorlib/shared/System/DateTime.cs index b5deefa94a..d3116ee25a 100644 --- a/src/mscorlib/shared/System/DateTime.cs +++ b/src/mscorlib/shared/System/DateTime.cs @@ -1141,13 +1141,6 @@ namespace System return (DateTimeParse.ParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style)); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public static DateTime ParseExact(ReadOnlySpan<char> s, string format, IFormatProvider provider, DateTimeStyles style) - { - if (format == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.format); - return ParseExact(s, (ReadOnlySpan<char>)format, provider, style); - } - public static DateTime ParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, IFormatProvider provider, DateTimeStyles style = DateTimeStyles.None) { DateTimeFormatInfo.ValidateStyles(style, nameof(style)); @@ -1300,10 +1293,6 @@ namespace System return DateTimeFormat.Format(this, format, DateTimeFormatInfo.GetInstance(provider)); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) => - TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider); - public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider provider = null) => DateTimeFormat.TryFormat(this, destination, out charsWritten, format, DateTimeFormatInfo.GetInstance(provider)); @@ -1359,18 +1348,6 @@ namespace System return DateTimeParse.TryParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style, out result); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public static bool TryParseExact(ReadOnlySpan<char> s, string format, IFormatProvider provider, DateTimeStyles style, out DateTime result) - { - if (format == null) - { - result = default; - return false; - } - - return TryParseExact(s, (ReadOnlySpan<char>)format, provider, style, out result); - } - public static bool TryParseExact(ReadOnlySpan<char> s, ReadOnlySpan<char> format, IFormatProvider provider, DateTimeStyles style, out DateTime result) { DateTimeFormatInfo.ValidateStyles(style, nameof(style)); diff --git a/src/mscorlib/shared/System/DateTimeOffset.cs b/src/mscorlib/shared/System/DateTimeOffset.cs index bb2196348c..1498f9365c 100644 --- a/src/mscorlib/shared/System/DateTimeOffset.cs +++ b/src/mscorlib/shared/System/DateTimeOffset.cs @@ -669,13 +669,6 @@ namespace System return new DateTimeOffset(dateResult.Ticks, offset); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public static DateTimeOffset ParseExact(ReadOnlySpan<char> input, string format, IFormatProvider formatProvider, DateTimeStyles styles) - { - if (format == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.format); - return ParseExact(input, (ReadOnlySpan<char>)format, formatProvider, styles); - } - public static DateTimeOffset ParseExact(ReadOnlySpan<char> input, ReadOnlySpan<char> format, IFormatProvider formatProvider, DateTimeStyles styles = DateTimeStyles.None) { styles = ValidateStyles(styles, nameof(styles)); @@ -780,10 +773,6 @@ namespace System return DateTimeFormat.Format(ClockDateTime, format, DateTimeFormatInfo.GetInstance(formatProvider), Offset); } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public bool TryFormat(Span<char> destination, out int charsWritten, string format, IFormatProvider provider) => - TryFormat(destination, out charsWritten, (ReadOnlySpan<char>)format, provider); - public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider formatProvider = null) => DateTimeFormat.TryFormat(ClockDateTime, destination, out charsWritten, format, DateTimeFormatInfo.GetInstance(formatProvider), Offset); @@ -862,18 +851,6 @@ namespace System return parsed; } - // TODO https://github.com/dotnet/corefx/issues/25337: Remove this overload once corefx is updated to target the new signatures - public static bool TryParseExact(ReadOnlySpan<char> input, string format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result) - { - if (format == null) - { - result = default; - return false; - } - - return TryParseExact(input, (ReadOnlySpan<char>)format, formatProvider, styles, out result); - } - public static bool TryParseExact( ReadOnlySpan<char> input, ReadOnlySpan<char> format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result) { |