From 15ea431db7cbb5bc2da11fcc3aacbf867546bc2f Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 9 Aug 2019 14:59:12 -0400 Subject: [PATCH] Contribute to IDE0060 (unused argument) Signed-off-by: dotnet-bot --- .../shared/System/Diagnostics/Tracing/EventSource.cs | 9 ++++----- .../Tracing/TraceLogging/TraceLoggingEventSource.cs | 2 +- .../shared/System/Globalization/DateTimeFormat.cs | 18 ++---------------- .../shared/System/Number.Formatting.cs | 10 +++++----- 4 files changed, 12 insertions(+), 27 deletions(-) diff --git a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs index 502c49a862c..2ad8126734f 100644 --- a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -2149,10 +2149,10 @@ namespace System.Diagnostics.Tracing eventCallbackArgs.Message = m_eventData[eventId].Message; eventCallbackArgs.Payload = new ReadOnlyCollection(args); - DispatchToAllListeners(eventId, childActivityID, eventCallbackArgs); + DispatchToAllListeners(eventId, eventCallbackArgs); } - private unsafe void DispatchToAllListeners(int eventId, Guid* childActivityID, EventWrittenEventArgs eventCallbackArgs) + private unsafe void DispatchToAllListeners(int eventId, EventWrittenEventArgs eventCallbackArgs) { Exception? lastThrownException = null; for (EventDispatcher? dispatcher = m_Dispatchers; dispatcher != null; dispatcher = dispatcher.m_Next) @@ -5897,7 +5897,7 @@ namespace System.Diagnostics.Tracing List? cultures = null; if (resources != null && (flags & EventManifestOptions.AllCultures) != 0) { - cultures = GetSupportedCultures(resources); + cultures = GetSupportedCultures(); } else { @@ -5984,9 +5984,8 @@ namespace System.Diagnostics.Tracing /// we enumerate through all the "known" cultures and attempt to load a corresponding satellite /// assembly /// - /// /// - private static List GetSupportedCultures(ResourceManager resources) + private static List GetSupportedCultures() { var cultures = new List(); diff --git a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs index 718f0e40d0b..e6b92659603 100644 --- a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs +++ b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs @@ -743,7 +743,7 @@ namespace System.Diagnostics.Tracing eventCallbackArgs.PayloadNames = new ReadOnlyCollection((IList)payload.Keys); } - DispatchToAllListeners(-1, pActivityId, eventCallbackArgs); + DispatchToAllListeners(-1, eventCallbackArgs); } #if (!ES_BUILD_PCL && !ES_BUILD_PN) diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs index 6f6d10ab94a..55d40398eca 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs @@ -689,7 +689,7 @@ namespace System break; case 'z': tokenLen = ParseRepeatPattern(format, i, ch); - FormatCustomizedTimeZone(dateTime, offset, format, tokenLen, bTimeOnly, result); + FormatCustomizedTimeZone(dateTime, offset, tokenLen, bTimeOnly, result); break; case 'K': tokenLen = 1; @@ -777,7 +777,7 @@ namespace System // output the 'z' famliy of formats, which output a the offset from UTC, e.g. "-07:30" - private static void FormatCustomizedTimeZone(DateTime dateTime, TimeSpan offset, ReadOnlySpan format, int tokenLen, bool timeOnly, StringBuilder result) + private static void FormatCustomizedTimeZone(DateTime dateTime, TimeSpan offset, int tokenLen, bool timeOnly, StringBuilder result) { // See if the instance already has an offset bool dateTimeFormat = (offset == NullOffset); @@ -958,10 +958,6 @@ namespace System // Convert to UTC invariants mean this will be in range dateTime = dateTime - offset; } - else if (dateTime.Kind == DateTimeKind.Local) - { - InvalidFormatForLocal(format, dateTime); - } dtfi = DateTimeFormatInfo.InvariantInfo; break; case 's': // Sortable without Time Zone Info @@ -973,10 +969,6 @@ namespace System // Convert to UTC invariants mean this will be in range dateTime = dateTime - offset; } - else if (dateTime.Kind == DateTimeKind.Local) - { - InvalidFormatForLocal(format, dateTime); - } dtfi = DateTimeFormatInfo.InvariantInfo; break; case 'U': // Universal time in culture dependent format. @@ -1394,11 +1386,5 @@ namespace System return results.ToArray(); } - - // This is a placeholder for an MDA to detect when the user is using a - // local DateTime with a format that will be interpreted as UTC. - internal static void InvalidFormatForLocal(ReadOnlySpan format, DateTime dateTime) - { - } } } diff --git a/netcore/System.Private.CoreLib/shared/System/Number.Formatting.cs b/netcore/System.Private.CoreLib/shared/System/Number.Formatting.cs index 2d3c2228f69..70e89347134 100644 --- a/netcore/System.Private.CoreLib/shared/System/Number.Formatting.cs +++ b/netcore/System.Private.CoreLib/shared/System/Number.Formatting.cs @@ -1633,7 +1633,7 @@ namespace System if (number.IsNegative) sb.Append(info.NegativeSign); - FormatFixed(ref sb, ref number, nMaxDigits, info, null, info.NumberDecimalSeparator, null); + FormatFixed(ref sb, ref number, nMaxDigits, null, info.NumberDecimalSeparator, null); break; } @@ -2115,7 +2115,7 @@ namespace System switch (ch) { case '#': - FormatFixed(ref sb, ref number, nMaxDigits, info, info._currencyGroupSizes, info.CurrencyDecimalSeparator, info.CurrencyGroupSeparator); + FormatFixed(ref sb, ref number, nMaxDigits, info._currencyGroupSizes, info.CurrencyDecimalSeparator, info.CurrencyGroupSeparator); break; case '-': sb.Append(info.NegativeSign); @@ -2130,7 +2130,7 @@ namespace System } } - private static unsafe void FormatFixed(ref ValueStringBuilder sb, ref NumberBuffer number, int nMaxDigits, NumberFormatInfo? info, int[]? groupDigits, string? sDecimal, string? sGroup) + private static unsafe void FormatFixed(ref ValueStringBuilder sb, ref NumberBuffer number, int nMaxDigits, int[]? groupDigits, string? sDecimal, string? sGroup) { int digPos = number.Scale; byte* dig = number.GetDigitsPointer(); @@ -2245,7 +2245,7 @@ namespace System switch (ch) { case '#': - FormatFixed(ref sb, ref number, nMaxDigits, info, info._numberGroupSizes, info.NumberDecimalSeparator, info.NumberGroupSeparator); + FormatFixed(ref sb, ref number, nMaxDigits, info._numberGroupSizes, info.NumberDecimalSeparator, info.NumberGroupSeparator); break; case '-': sb.Append(info.NegativeSign); @@ -2352,7 +2352,7 @@ namespace System switch (ch) { case '#': - FormatFixed(ref sb, ref number, nMaxDigits, info, info._percentGroupSizes, info.PercentDecimalSeparator, info.PercentGroupSeparator); + FormatFixed(ref sb, ref number, nMaxDigits, info._percentGroupSizes, info.PercentDecimalSeparator, info.PercentGroupSeparator); break; case '-': sb.Append(info.NegativeSign); -- 2.11.4.GIT