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

Commit

Permalink
Fix IDE0062 (make local functions static)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Aug 13, 2019
1 parent 6426282 commit 117217f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public DefaultValueAttribute(Type type, string? value)
}

// Looking for ad hoc created TypeDescriptor.ConvertFromInvariantString(Type, string)
bool TryConvertFromInvariantString(Type? typeToConvert, string? stringValue, out object? conversionResult)
static bool TryConvertFromInvariantString(Type? typeToConvert, string? stringValue, out object? conversionResult)
{
conversionResult = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static int GetWeeksInYear(int year)
throw new ArgumentOutOfRangeException(nameof(year), SR.ArgumentOutOfRange_Year);
}

int P(int y) => (y + (y / 4) - (y / 100) + (y / 400)) % 7;
static int P(int y) => (y + (y / 4) - (y / 100) + (y / 400)) % 7;

if (P(year) == 4 || P(year - 1) == 3)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public static NumberFormatInfo GetInstance(IFormatProvider? formatProvider)
CurrentInfo : // Fast path for a null provider
GetProviderNonNull(formatProvider);

NumberFormatInfo GetProviderNonNull(IFormatProvider provider)
static NumberFormatInfo GetProviderNonNull(IFormatProvider provider)
{
// Fast path for a regular CultureInfo
if (provider is CultureInfo cultureProvider && !cultureProvider._isInherited)
Expand Down
2 changes: 1 addition & 1 deletion src/System.Private.CoreLib/shared/System/IO/Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public virtual ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken c
byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
return FinishReadAsync(ReadAsync(sharedBuffer, 0, buffer.Length, cancellationToken), sharedBuffer, buffer);

async ValueTask<int> FinishReadAsync(Task<int> readTask, byte[] localBuffer, Memory<byte> localDestination)
static async ValueTask<int> FinishReadAsync(Task<int> readTask, byte[] localBuffer, Memory<byte> localDestination)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,7 @@ internal static unsafe void RoundNumber(ref NumberBuffer number, int pos, bool i
number.DigitsCount = i;
number.CheckConsistency();

bool ShouldRoundUp(byte* dig, int i, NumberBufferKind numberKind, bool isCorrectlyRounded)
static bool ShouldRoundUp(byte* dig, int i, NumberBufferKind numberKind, bool isCorrectlyRounded)
{
// We only want to round up if the digit is greater than or equal to 5 and we are
// not rounding a floating-point number. If we are rounding a floating-point number
Expand Down

0 comments on commit 117217f

Please sign in to comment.