mirror of https://github.com/dotnet/runtime
Enable IDE0170 (Simplify property pattern) and IDE0200 (remove unnecessary lambda expression) (#71011)
As part of updating the config file with recently added rules, also turn on a few of them.
This commit is contained in:
parent
14f993e9e0
commit
9f7bf79991
|
@ -1445,9 +1445,6 @@ dotnet_diagnostic.IDE0048.severity = silent
|
|||
# IDE0049: Use language keywords instead of framework type names for type references
|
||||
dotnet_diagnostic.IDE0049.severity = warning
|
||||
|
||||
# IDE0050: Convert anonymous type to tuple
|
||||
dotnet_diagnostic.IDE0050.severity = suggestion
|
||||
|
||||
# IDE0051: Remove unused private members
|
||||
dotnet_diagnostic.IDE0051.severity = suggestion
|
||||
|
||||
|
@ -1569,6 +1566,27 @@ dotnet_diagnostic.IDE0160.severity = silent
|
|||
# IDE0161: Convert to file-scoped namespace
|
||||
dotnet_diagnostic.IDE0161.severity = silent
|
||||
|
||||
# IDE0170: Simplify property pattern
|
||||
dotnet_diagnostic.IDE0170.severity = warning
|
||||
|
||||
# IDE0180: Use tuple swap
|
||||
dotnet_diagnostic.IDE0180.severity = suggestion
|
||||
|
||||
# IDE0200: Remove unnecessary lambda expression
|
||||
dotnet_diagnostic.IDE0200.severity = warning
|
||||
|
||||
# IDE0210: Use top-level statements
|
||||
dotnet_diagnostic.IDE0210.severity = silent
|
||||
|
||||
# IDE0211: Use program main
|
||||
dotnet_diagnostic.IDE0211.severity = silent
|
||||
|
||||
# IDE0220: foreach cast
|
||||
dotnet_diagnostic.IDE0220.severity = silent
|
||||
|
||||
# IDE0230: Use UTF8 string literal
|
||||
dotnet_diagnostic.IDE0230.severity = suggestion
|
||||
|
||||
# IDE1005: Delegate invocation can be simplified.
|
||||
dotnet_diagnostic.IDE1005.severity = warning
|
||||
|
||||
|
|
|
@ -1440,9 +1440,6 @@ dotnet_diagnostic.IDE0048.severity = silent
|
|||
# IDE0049: Use language keywords instead of framework type names for type references
|
||||
dotnet_diagnostic.IDE0049.severity = silent
|
||||
|
||||
# IDE0050: Convert anonymous type to tuple
|
||||
dotnet_diagnostic.IDE0050.severity = silent
|
||||
|
||||
# IDE0051: Remove unused private members
|
||||
dotnet_diagnostic.IDE0051.severity = silent
|
||||
|
||||
|
@ -1563,6 +1560,27 @@ dotnet_diagnostic.IDE0160.severity = silent
|
|||
# IDE0161: Convert to file-scoped namespace
|
||||
dotnet_diagnostic.IDE0161.severity = silent
|
||||
|
||||
# IDE0170: Simplify property pattern
|
||||
dotnet_diagnostic.IDE0170.severity = silent
|
||||
|
||||
# IDE0180: Use tuple swap
|
||||
dotnet_diagnostic.IDE0180.severity = silent
|
||||
|
||||
# IDE0200: Remove unnecessary lambda expression
|
||||
dotnet_diagnostic.IDE0200.severity = silent
|
||||
|
||||
# IDE0210: Use top-level statements
|
||||
dotnet_diagnostic.IDE0210.severity = silent
|
||||
|
||||
# IDE0211: Use program main
|
||||
dotnet_diagnostic.IDE0211.severity = silent
|
||||
|
||||
# IDE0220: foreach cast
|
||||
dotnet_diagnostic.IDE0220.severity = silent
|
||||
|
||||
# IDE0230: Use UTF8 string literal
|
||||
dotnet_diagnostic.IDE0230.severity = silent
|
||||
|
||||
# IDE1005: Delegate invocation can be simplified.
|
||||
dotnet_diagnostic.IDE1005.severity = silent
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace System.Runtime.InteropServices
|
|||
[RequiresDynamicCode("Marshalling code for the object might not be available")]
|
||||
public static byte ReadByte(object ptr, int ofs)
|
||||
{
|
||||
return ReadValueSlow(ptr, ofs, (IntPtr nativeHome, int offset) => ReadByte(nativeHome, offset));
|
||||
return ReadValueSlow(ptr, ofs, ReadByte);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
@ -65,7 +65,7 @@ namespace System.Runtime.InteropServices
|
|||
[RequiresDynamicCode("Marshalling code for the object might not be available")]
|
||||
public static short ReadInt16(object ptr, int ofs)
|
||||
{
|
||||
return ReadValueSlow(ptr, ofs, (IntPtr nativeHome, int offset) => ReadInt16(nativeHome, offset));
|
||||
return ReadValueSlow(ptr, ofs, ReadInt16);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
@ -73,7 +73,7 @@ namespace System.Runtime.InteropServices
|
|||
[RequiresDynamicCode("Marshalling code for the object might not be available")]
|
||||
public static int ReadInt32(object ptr, int ofs)
|
||||
{
|
||||
return ReadValueSlow(ptr, ofs, (IntPtr nativeHome, int offset) => ReadInt32(nativeHome, offset));
|
||||
return ReadValueSlow(ptr, ofs, ReadInt32);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
@ -83,7 +83,7 @@ namespace System.Runtime.InteropServices
|
|||
public static long ReadInt64([MarshalAs(UnmanagedType.AsAny), In] object ptr, int ofs)
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
{
|
||||
return ReadValueSlow(ptr, ofs, (IntPtr nativeHome, int offset) => ReadInt64(nativeHome, offset));
|
||||
return ReadValueSlow(ptr, ofs, ReadInt64);
|
||||
}
|
||||
|
||||
/// <summary>Read value from marshaled object (marshaled using AsAny).</summary>
|
||||
|
@ -125,7 +125,7 @@ namespace System.Runtime.InteropServices
|
|||
[RequiresDynamicCode("Marshalling code for the object might not be available")]
|
||||
public static void WriteByte(object ptr, int ofs, byte val)
|
||||
{
|
||||
WriteValueSlow(ptr, ofs, val, (IntPtr nativeHome, int offset, byte value) => WriteByte(nativeHome, offset, value));
|
||||
WriteValueSlow(ptr, ofs, val, WriteByte);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
@ -133,7 +133,7 @@ namespace System.Runtime.InteropServices
|
|||
[RequiresDynamicCode("Marshalling code for the object might not be available")]
|
||||
public static void WriteInt16(object ptr, int ofs, short val)
|
||||
{
|
||||
WriteValueSlow(ptr, ofs, val, (IntPtr nativeHome, int offset, short value) => Marshal.WriteInt16(nativeHome, offset, value));
|
||||
WriteValueSlow(ptr, ofs, val, Marshal.WriteInt16);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
@ -141,7 +141,7 @@ namespace System.Runtime.InteropServices
|
|||
[RequiresDynamicCode("Marshalling code for the object might not be available")]
|
||||
public static void WriteInt32(object ptr, int ofs, int val)
|
||||
{
|
||||
WriteValueSlow(ptr, ofs, val, (IntPtr nativeHome, int offset, int value) => Marshal.WriteInt32(nativeHome, offset, value));
|
||||
WriteValueSlow(ptr, ofs, val, Marshal.WriteInt32);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
|
@ -149,7 +149,7 @@ namespace System.Runtime.InteropServices
|
|||
[RequiresDynamicCode("Marshalling code for the object might not be available")]
|
||||
public static void WriteInt64(object ptr, int ofs, long val)
|
||||
{
|
||||
WriteValueSlow(ptr, ofs, val, (IntPtr nativeHome, int offset, long value) => Marshal.WriteInt64(nativeHome, offset, value));
|
||||
WriteValueSlow(ptr, ofs, val, Marshal.WriteInt64);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -31,8 +31,8 @@ internal static partial class Interop
|
|||
// wrong endianness here), DER encode it, then use the DER reader to skip past the tag
|
||||
// and length.
|
||||
byte[] derEncoded = OpenSslEncode(
|
||||
handle => GetAsn1IntegerDerSize(handle),
|
||||
(handle, buf) => EncodeAsn1Integer(handle, buf),
|
||||
GetAsn1IntegerDerSize,
|
||||
EncodeAsn1Integer,
|
||||
asn1Integer);
|
||||
|
||||
try
|
||||
|
|
|
@ -20,7 +20,7 @@ internal static partial class Interop
|
|||
|
||||
internal static int ResolveRequiredNid(string oid)
|
||||
{
|
||||
return s_nidLookup.GetOrAdd(oid, s => LookupNid(s));
|
||||
return s_nidLookup.GetOrAdd(oid, LookupNid);
|
||||
}
|
||||
|
||||
private static int LookupNid(string oid)
|
||||
|
|
|
@ -107,25 +107,25 @@ internal static partial class Interop
|
|||
|
||||
internal static byte[] GetAsn1StringBytes(IntPtr asn1)
|
||||
{
|
||||
return GetDynamicBuffer((ptr, buf, i) => GetAsn1StringBytes(ptr, buf, i), asn1);
|
||||
return GetDynamicBuffer(GetAsn1StringBytes, asn1);
|
||||
}
|
||||
|
||||
internal static byte[] GetX509Thumbprint(SafeX509Handle x509)
|
||||
{
|
||||
return GetDynamicBuffer((handle, buf, i) => GetX509Thumbprint(handle, buf, i), x509);
|
||||
return GetDynamicBuffer(GetX509Thumbprint, x509);
|
||||
}
|
||||
|
||||
internal static X500DistinguishedName LoadX500Name(IntPtr namePtr)
|
||||
{
|
||||
CheckValidOpenSslHandle(namePtr);
|
||||
|
||||
byte[] buf = GetDynamicBuffer((ptr, buf1, i) => GetX509NameRawBytes(ptr, buf1, i), namePtr);
|
||||
byte[] buf = GetDynamicBuffer(GetX509NameRawBytes, namePtr);
|
||||
return new X500DistinguishedName(buf);
|
||||
}
|
||||
|
||||
internal static byte[] GetX509PublicKeyParameterBytes(SafeX509Handle x509)
|
||||
{
|
||||
return GetDynamicBuffer((handle, buf, i) => GetX509PublicKeyParameterBytes(handle, buf, i), x509);
|
||||
return GetDynamicBuffer(GetX509PublicKeyParameterBytes, x509);
|
||||
}
|
||||
|
||||
internal static void X509StoreSetVerifyTime(SafeX509StoreHandle ctx, DateTime verifyTime)
|
||||
|
|
|
@ -10,7 +10,7 @@ internal static partial class Interop
|
|||
{
|
||||
internal static ArraySegment<byte> RentAsn1StringBytes(IntPtr asn1)
|
||||
{
|
||||
return RentDynamicBuffer((ptr, buf, i) => GetAsn1StringBytes(ptr, buf, i), asn1);
|
||||
return RentDynamicBuffer(GetAsn1StringBytes, asn1);
|
||||
}
|
||||
|
||||
private static ArraySegment<byte> RentDynamicBuffer<THandle>(NegativeSizeReadMethod<THandle> method, THandle handle)
|
||||
|
|
|
@ -90,7 +90,7 @@ internal static partial class Interop
|
|||
CheckValidOpenSslHandle(x);
|
||||
|
||||
return SafeInteriorHandle.OpenInteriorHandle(
|
||||
handle => X509GetSerialNumber_private(handle),
|
||||
X509GetSerialNumber_private,
|
||||
x);
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ internal static partial class Interop
|
|||
CheckValidOpenSslHandle(x);
|
||||
|
||||
return SafeInteriorHandle.OpenInteriorHandle(
|
||||
(handle, arg) => CryptoNative_X509FindExtensionData(handle, arg),
|
||||
CryptoNative_X509FindExtensionData,
|
||||
x,
|
||||
extensionNid);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ internal static partial class Interop
|
|||
{
|
||||
CheckValidOpenSslHandle(namePtr);
|
||||
|
||||
byte[] buf = GetDynamicBuffer((ptr, buf1, i) => GetX509NameRawBytes(ptr, buf1, i), namePtr);
|
||||
byte[] buf = GetDynamicBuffer(GetX509NameRawBytes, namePtr);
|
||||
return new X500DistinguishedName(buf);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ internal static partial class Interop
|
|||
CheckValidOpenSslHandle(sk);
|
||||
|
||||
return SafeInteriorHandle.OpenInteriorHandle(
|
||||
(handle, i) => GetX509NameStackField_private(handle, i),
|
||||
GetX509NameStackField_private,
|
||||
sk,
|
||||
loc);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ internal static partial class Interop
|
|||
internal static SafeSharedX509StackHandle X509StoreCtxGetSharedUntrusted(SafeX509StoreCtxHandle ctx)
|
||||
{
|
||||
return SafeInteriorHandle.OpenInteriorHandle(
|
||||
x => X509StoreCtxGetSharedUntrusted_private(x),
|
||||
X509StoreCtxGetSharedUntrusted_private,
|
||||
ctx);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace System.Security.Cryptography
|
|||
hashAlgorithm,
|
||||
secretPrepend,
|
||||
secretAppend,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
public override byte[] DeriveKeyFromHmac(
|
||||
|
@ -54,7 +54,7 @@ namespace System.Security.Cryptography
|
|||
hmacKey,
|
||||
secretPrepend,
|
||||
secretAppend,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
public override byte[] DeriveKeyTls(ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed)
|
||||
|
@ -69,7 +69,7 @@ namespace System.Security.Cryptography
|
|||
otherPartyPublicKey,
|
||||
prfLabel,
|
||||
prfSeed,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace System.Security.Cryptography
|
|||
hashAlgorithm,
|
||||
secretPrepend,
|
||||
secretAppend,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
public override byte[] DeriveKeyFromHmac(
|
||||
|
@ -51,7 +51,7 @@ namespace System.Security.Cryptography
|
|||
hmacKey,
|
||||
secretPrepend,
|
||||
secretAppend,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
public override byte[] DeriveKeyTls(ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed)
|
||||
|
@ -66,7 +66,7 @@ namespace System.Security.Cryptography
|
|||
otherPartyPublicKey,
|
||||
prfLabel,
|
||||
prfSeed,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace System.Security.Cryptography
|
|||
hashAlgorithm,
|
||||
secretPrepend,
|
||||
secretAppend,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
public override byte[] DeriveKeyFromHmac(
|
||||
|
@ -157,7 +157,7 @@ namespace System.Security.Cryptography
|
|||
hmacKey,
|
||||
secretPrepend,
|
||||
secretAppend,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
public override byte[] DeriveKeyTls(ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed)
|
||||
|
@ -172,7 +172,7 @@ namespace System.Security.Cryptography
|
|||
otherPartyPublicKey,
|
||||
prfLabel,
|
||||
prfSeed,
|
||||
(pubKey, hasher) => DeriveSecretAgreement(pubKey, hasher));
|
||||
DeriveSecretAgreement);
|
||||
}
|
||||
|
||||
private byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher)
|
||||
|
|
|
@ -120,7 +120,7 @@ namespace Microsoft.Extensions.Configuration
|
|||
IConfigurationProvider provider = source.Build(this);
|
||||
|
||||
provider.Load();
|
||||
_changeTokenRegistrations.Add(ChangeToken.OnChange(() => provider.GetReloadToken(), () => RaiseChanged()));
|
||||
_changeTokenRegistrations.Add(ChangeToken.OnChange(provider.GetReloadToken, RaiseChanged));
|
||||
|
||||
_providerManager.AddProvider(provider);
|
||||
RaiseChanged();
|
||||
|
@ -143,7 +143,7 @@ namespace Microsoft.Extensions.Configuration
|
|||
foreach (IConfigurationProvider p in newProvidersList)
|
||||
{
|
||||
p.Load();
|
||||
_changeTokenRegistrations.Add(ChangeToken.OnChange(() => p.GetReloadToken(), () => RaiseChanged()));
|
||||
_changeTokenRegistrations.Add(ChangeToken.OnChange(p.GetReloadToken, RaiseChanged));
|
||||
}
|
||||
|
||||
_providerManager.ReplaceProviders(newProvidersList);
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace Microsoft.Extensions.Configuration
|
|||
foreach (IConfigurationProvider p in providers)
|
||||
{
|
||||
p.Load();
|
||||
_changeTokenRegistrations.Add(ChangeToken.OnChange(() => p.GetReloadToken(), () => RaiseChanged()));
|
||||
_changeTokenRegistrations.Add(ChangeToken.OnChange(p.GetReloadToken, RaiseChanged));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
|
|||
{
|
||||
if (!_stackGuard.TryEnterOnCurrentStack())
|
||||
{
|
||||
return _stackGuard.RunOnEmptyStack((type, chain) => CreateCallSite(type, chain), serviceType, callSiteChain);
|
||||
return _stackGuard.RunOnEmptyStack(CreateCallSite, serviceType, callSiteChain);
|
||||
}
|
||||
|
||||
// We need to lock the resolution process for a single service type at a time:
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
|
|||
{
|
||||
if (!_stackGuard.TryEnterOnCurrentStack())
|
||||
{
|
||||
return _stackGuard.RunOnEmptyStack((c, a) => VisitCallSite(c, a), callSite, argument);
|
||||
return _stackGuard.RunOnEmptyStack(VisitCallSite, callSite, argument);
|
||||
}
|
||||
|
||||
switch (callSite.Cache.Location)
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace Microsoft.Extensions.FileProviders
|
|||
}
|
||||
|
||||
_filters = filters;
|
||||
_fileWatcherFactory = () => CreateFileWatcher();
|
||||
_fileWatcherFactory = CreateFileWatcher;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -54,10 +54,7 @@ namespace Microsoft.Extensions.Hosting.WindowsServices
|
|||
{
|
||||
Logger.LogInformation("Application is shutting down...");
|
||||
});
|
||||
ApplicationLifetime.ApplicationStopped.Register(() =>
|
||||
{
|
||||
_delayStop.Set();
|
||||
});
|
||||
ApplicationLifetime.ApplicationStopped.Register(_delayStop.Set);
|
||||
|
||||
Thread thread = new Thread(Run);
|
||||
thread.IsBackground = true;
|
||||
|
|
|
@ -36,8 +36,8 @@ namespace Microsoft.Extensions.Options
|
|||
void RegisterSource(IOptionsChangeTokenSource<TOptions> source)
|
||||
{
|
||||
IDisposable registration = ChangeToken.OnChange(
|
||||
() => source.GetChangeToken(),
|
||||
(name) => InvokeChanged(name),
|
||||
source.GetChangeToken,
|
||||
InvokeChanged,
|
||||
source.Name);
|
||||
|
||||
_registrations.Add(registration);
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace System.ComponentModel.DataAnnotations
|
|||
if (serviceProvider != null)
|
||||
{
|
||||
IServiceProvider localServiceProvider = serviceProvider;
|
||||
InitializeServiceProvider(serviceType => localServiceProvider.GetService(serviceType));
|
||||
InitializeServiceProvider(localServiceProvider.GetService);
|
||||
}
|
||||
|
||||
_items = items != null ? new Dictionary<object, object?>(items) : new Dictionary<object, object?>();
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace System.ComponentModel.Composition
|
|||
Requires.NotNullOrNullElements(attributedParts, nameof(attributedParts));
|
||||
|
||||
CompositionBatch batch = new CompositionBatch(
|
||||
attributedParts.Select(attributedPart => AttributedModelServices.CreatePart(attributedPart)).ToArray(),
|
||||
attributedParts.Select(AttributedModelServices.CreatePart).ToArray(),
|
||||
Enumerable.Empty<ComposablePart>());
|
||||
|
||||
container.Compose(batch);
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace System.ComponentModel.Composition.Hosting
|
|||
{
|
||||
traversal.Initialize();
|
||||
var traversalClosure = GetTraversalClosure(_innerCatalog.Where(_filter), traversal);
|
||||
return new FilteredCatalog(_innerCatalog, p => traversalClosure.Contains(p));
|
||||
return new FilteredCatalog(_innerCatalog, traversalClosure.Contains);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace System.ComponentModel.Composition.ReflectionModel
|
|||
|
||||
if (disposable != null)
|
||||
{
|
||||
disposeAction = () => disposable.Dispose();
|
||||
disposeAction = disposable.Dispose;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace System.ComponentModel.Composition.ReflectionModel
|
|||
}
|
||||
|
||||
Func<Export, object> exportFactoryFactory = (Func<Export, object>)Delegate.CreateDelegate(typeof(Func<Export, object>), this, genericMethod);
|
||||
return (e) => exportFactoryFactory.Invoke(e);
|
||||
return exportFactoryFactory.Invoke;
|
||||
}
|
||||
|
||||
private object CreateStronglyTypedExportFactoryOfT<T>(Export export)
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace System.ComponentModel
|
|||
|
||||
_asyncOperation = AsyncOperationManager.CreateOperation(null);
|
||||
Task.Factory.StartNew(
|
||||
arg => WorkerThreadStart(arg),
|
||||
WorkerThreadStart,
|
||||
argument,
|
||||
CancellationToken.None,
|
||||
TaskCreationOptions.DenyChildAttach,
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace System.Composition.Hosting.Core
|
|||
/// <summary>
|
||||
/// Constant value provided so that subclasses can avoid creating additional duplicate values.
|
||||
/// </summary>
|
||||
protected static readonly Func<IEnumerable<CompositionDependency>> NoDependencies = () => Enumerable.Empty<CompositionDependency>();
|
||||
protected static readonly Func<IEnumerable<CompositionDependency>> NoDependencies = Enumerable.Empty<CompositionDependency>;
|
||||
|
||||
/// <summary>
|
||||
/// Promise export descriptors for the specified export key.
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace System.Composition.Hosting.Util
|
|||
}
|
||||
|
||||
var name = closedGenericType.Name.Substring(0, closedGenericType.Name.IndexOf('`'));
|
||||
var args = closedGenericType.GenericTypeArguments.Select(t => Format(t));
|
||||
var args = closedGenericType.GenericTypeArguments.Select(Format);
|
||||
return $"{name}<{string.Join(", ", args)}>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace System.Composition.Runtime.Util
|
|||
Debug.Assert(closedGenericType.IsConstructedGenericType);
|
||||
|
||||
var name = closedGenericType.Name.Substring(0, closedGenericType.Name.IndexOf('`'));
|
||||
IEnumerable<string> args = closedGenericType.GenericTypeArguments.Select(t => Format(t));
|
||||
IEnumerable<string> args = closedGenericType.GenericTypeArguments.Select(Format);
|
||||
return $"{name}<{string.Join(SR.Formatter_ListSeparatorWithSpace, args)}>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace System.Data.Common
|
|||
}
|
||||
|
||||
// to support oracle types and other INUllable types that have static Null as field
|
||||
internal static object GetStaticNullForUdtType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type type) => s_typeToNull.GetOrAdd(type, t => GetStaticNullForUdtTypeCore(t));
|
||||
internal static object GetStaticNullForUdtType([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicFields)] Type type) => s_typeToNull.GetOrAdd(type, GetStaticNullForUdtTypeCore);
|
||||
|
||||
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2070:UnrecognizedReflectionPattern",
|
||||
Justification = "The only callsite is marked with DynamicallyAccessedMembers. Workaround for https://github.com/mono/linker/issues/1981")]
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace System.Data
|
|||
private static IEnumerable<Type> GetPreviouslyDeclaredDataTypes(DataSet dataSet)
|
||||
{
|
||||
return (dataSet != null)
|
||||
? dataSet.Tables.Cast<DataTable>().SelectMany(table => GetPreviouslyDeclaredDataTypes(table))
|
||||
? dataSet.Tables.Cast<DataTable>().SelectMany(GetPreviouslyDeclaredDataTypes)
|
||||
: Enumerable.Empty<Type>();
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace System.Diagnostics.Metrics
|
|||
{
|
||||
if (instrument is not null && !_disposed && !instrument.Meter.Disposed)
|
||||
{
|
||||
_enabledMeasurementInstruments.AddIfNotExist(instrument, (instrument1, instrument2) => object.ReferenceEquals(instrument1, instrument2));
|
||||
_enabledMeasurementInstruments.AddIfNotExist(instrument, object.ReferenceEquals);
|
||||
oldState = instrument.EnableMeasurement(new ListenerSubscription(this, state), out oldStateStored);
|
||||
enabled = true;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ namespace System.Diagnostics.Metrics
|
|||
object? state = null;
|
||||
lock (Instrument.SyncObject)
|
||||
{
|
||||
if (instrument is null || _enabledMeasurementInstruments.Remove(instrument, (instrument1, instrument2) => object.ReferenceEquals(instrument1, instrument2)) == default)
|
||||
if (instrument is null || _enabledMeasurementInstruments.Remove(instrument, object.ReferenceEquals) == default)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
|
|
@ -443,7 +443,7 @@ namespace System.Formats.Asn1
|
|||
source,
|
||||
ruleSet,
|
||||
tmpDest,
|
||||
(value, lastByte, dest) => CopyBitStringValue(value, lastByte, dest),
|
||||
CopyBitStringValue,
|
||||
isIndefinite,
|
||||
out unusedBitCount,
|
||||
out bytesRead);
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace System.Net.Http
|
|||
|
||||
private static readonly StringWithQualityHeaderValue s_gzipHeaderValue = new StringWithQualityHeaderValue("gzip");
|
||||
private static readonly StringWithQualityHeaderValue s_deflateHeaderValue = new StringWithQualityHeaderValue("deflate");
|
||||
private static readonly Lazy<bool> s_supportsTls13 = new Lazy<bool>(() => CheckTls13Support());
|
||||
private static readonly Lazy<bool> s_supportsTls13 = new Lazy<bool>(CheckTls13Support);
|
||||
|
||||
[ThreadStatic]
|
||||
private static StringBuilder? t_requestHeadersBuilder;
|
||||
|
|
|
@ -548,7 +548,7 @@ namespace System.Net
|
|||
|
||||
public static IWebProxy? DefaultWebProxy
|
||||
{
|
||||
get => LazyInitializer.EnsureInitialized<IWebProxy>(ref s_DefaultWebProxy, ref s_DefaultWebProxyInitialized, ref s_internalSyncObject, () => GetSystemWebProxy());
|
||||
get => LazyInitializer.EnsureInitialized<IWebProxy>(ref s_DefaultWebProxy, ref s_DefaultWebProxyInitialized, ref s_internalSyncObject, GetSystemWebProxy);
|
||||
set
|
||||
{
|
||||
lock (s_internalSyncObject)
|
||||
|
|
|
@ -194,7 +194,7 @@ namespace Internal.Runtime.InteropServices
|
|||
IntPtr delegateTypeNative)
|
||||
{
|
||||
// Create a resolver callback for types.
|
||||
Func<AssemblyName, Assembly> resolver = name => alc.LoadFromAssemblyName(name);
|
||||
Func<AssemblyName, Assembly> resolver = alc.LoadFromAssemblyName;
|
||||
|
||||
// Determine the signature of the type. There are 3 possibilities:
|
||||
// * No delegate type was supplied - use the default (i.e. ComponentEntryPoint).
|
||||
|
|
|
@ -381,8 +381,7 @@ namespace System.Diagnostics.Tracing
|
|||
List<SessionInfo>? liveSessionList = null;
|
||||
|
||||
GetSessionInfo(
|
||||
(int etwSessionId, long matchAllKeywords, ref List<SessionInfo>? sessionList) =>
|
||||
GetSessionInfoCallback(etwSessionId, matchAllKeywords, ref sessionList),
|
||||
GetSessionInfoCallback,
|
||||
ref liveSessionList);
|
||||
|
||||
List<KeyValuePair<SessionInfo, bool>> changedSessionList = new List<KeyValuePair<SessionInfo, bool>>();
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace System.IO
|
|||
using SafeFileHandle src = SafeFileHandle.OpenReadOnly(sourceFullPath, FileOptions.None, out fileLength, out filePermissions);
|
||||
using SafeFileHandle dst = SafeFileHandle.Open(destFullPath, overwrite ? FileMode.Create : FileMode.CreateNew,
|
||||
FileAccess.ReadWrite, FileShare.None, FileOptions.None, preallocationSize: 0, filePermissions,
|
||||
(Interop.ErrorInfo error, Interop.Sys.OpenFlags flags, string path) => CreateOpenException(error, flags, path));
|
||||
CreateOpenException);
|
||||
|
||||
Interop.CheckIo(Interop.Sys.CopyFile(src, dst, fileLength));
|
||||
|
||||
|
|
|
@ -71,10 +71,7 @@ namespace System.Runtime.Serialization
|
|||
}
|
||||
else
|
||||
{
|
||||
return (obj) =>
|
||||
{
|
||||
return propInfo.GetValue(obj);
|
||||
};
|
||||
return propInfo.GetValue;
|
||||
}
|
||||
}
|
||||
else if (memberInfo is FieldInfo fieldInfo)
|
||||
|
|
|
@ -169,7 +169,7 @@ namespace System.Xml.Serialization
|
|||
{
|
||||
var xmlns = new XmlSerializerNamespaces();
|
||||
p[index] = xmlns;
|
||||
member.XmlnsSource = (ns, name) => xmlns.Add(ns, name);
|
||||
member.XmlnsSource = xmlns.Add;
|
||||
}
|
||||
|
||||
member.Source = source;
|
||||
|
@ -198,10 +198,7 @@ namespace System.Xml.Serialization
|
|||
{
|
||||
anyMember.Collection = new CollectionMember();
|
||||
anyMember.ArraySource = anyMember.Source;
|
||||
anyMember.Source = (item) =>
|
||||
{
|
||||
anyMember.Collection.Add(item);
|
||||
};
|
||||
anyMember.Source = anyMember.Collection.Add;
|
||||
|
||||
anyAttribute = anyMember;
|
||||
}
|
||||
|
@ -225,10 +222,7 @@ namespace System.Xml.Serialization
|
|||
if (mapping.Attribute == null && mapping.Text == null)
|
||||
{
|
||||
anyMember.Collection = new CollectionMember();
|
||||
anyMember.ArraySource = (item) =>
|
||||
{
|
||||
anyMember.Collection.Add(item);
|
||||
};
|
||||
anyMember.ArraySource = anyMember.Collection.Add;
|
||||
|
||||
textOrArrayMembersList.Add(anyMember);
|
||||
}
|
||||
|
@ -247,10 +241,7 @@ namespace System.Xml.Serialization
|
|||
&& !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping))
|
||||
{
|
||||
anyMember.Collection = new CollectionMember();
|
||||
anyMember.ArraySource = (item) =>
|
||||
{
|
||||
anyMember.Collection.Add(item);
|
||||
};
|
||||
anyMember.ArraySource = anyMember.Collection.Add;
|
||||
|
||||
membersList.Add(anyMember);
|
||||
textOrArrayMembersList.Add(anyMember);
|
||||
|
@ -1163,10 +1154,7 @@ namespace System.Xml.Serialization
|
|||
|
||||
var arrayMember = new Member(memberMapping);
|
||||
arrayMember.Collection = new CollectionMember();
|
||||
arrayMember.ArraySource = (item) =>
|
||||
{
|
||||
arrayMember.Collection.Add(item);
|
||||
};
|
||||
arrayMember.ArraySource = arrayMember.Collection.Add;
|
||||
|
||||
if ((readOnly && o == null) || Reader.IsEmptyElement)
|
||||
{
|
||||
|
@ -1720,10 +1708,7 @@ namespace System.Xml.Serialization
|
|||
var xmlSerializerNamespaces = new XmlSerializerNamespaces();
|
||||
var setMemberValue = GetSetMemberValueDelegate(o!, member.Mapping.Name);
|
||||
setMemberValue(o, xmlSerializerNamespaces);
|
||||
member.XmlnsSource = (ns, name) =>
|
||||
{
|
||||
xmlSerializerNamespaces.Add(ns, name);
|
||||
};
|
||||
member.XmlnsSource = xmlSerializerNamespaces.Add;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2126,17 +2111,11 @@ namespace System.Xml.Serialization
|
|||
{
|
||||
if (memberInfo is PropertyInfo propInfo)
|
||||
{
|
||||
return delegate (object? o, object? p)
|
||||
{
|
||||
propInfo.SetValue(o, p);
|
||||
};
|
||||
return propInfo.SetValue;
|
||||
}
|
||||
else if (memberInfo is FieldInfo fieldInfo)
|
||||
{
|
||||
return delegate (object? o, object? p)
|
||||
{
|
||||
fieldInfo.SetValue(o, p);
|
||||
};
|
||||
return fieldInfo.SetValue;
|
||||
}
|
||||
|
||||
throw new InvalidOperationException(SR.XmlInternalError);
|
||||
|
@ -2149,11 +2128,7 @@ namespace System.Xml.Serialization
|
|||
var setMethod = propInfo.GetSetMethod(true);
|
||||
if (setMethod == null)
|
||||
{
|
||||
return delegate (object? o, object? p)
|
||||
{
|
||||
// Maintain the same failure behavior as non-cached delegate
|
||||
propInfo.SetValue(o, p);
|
||||
};
|
||||
return propInfo.SetValue;
|
||||
}
|
||||
|
||||
setTypedDelegate = (Action<TObj, TParam>)setMethod.CreateDelegate(typeof(Action<TObj, TParam>));
|
||||
|
|
|
@ -273,10 +273,7 @@ namespace System.Reflection.TypeLoading
|
|||
MetadataLoadContext loader = defaultAssembly.Loader;
|
||||
|
||||
Func<AssemblyName, Assembly> assemblyResolver =
|
||||
delegate (AssemblyName assemblyName)
|
||||
{
|
||||
return loader.LoadFromAssemblyName(assemblyName);
|
||||
};
|
||||
loader.LoadFromAssemblyName;
|
||||
|
||||
Func<Assembly?, string, bool, Type?> typeResolver =
|
||||
delegate (Assembly? assembly, string fullName, bool ignoreCase2)
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace System.Runtime.Serialization
|
|||
|
||||
internal static SerializationEvents GetSerializationEventsForType(
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type t) =>
|
||||
s_cache.GetOrAdd(t, type => CreateSerializationEvents(type));
|
||||
s_cache.GetOrAdd(t, CreateSerializationEvents);
|
||||
|
||||
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2067:UnrecognizedReflectionPattern",
|
||||
Justification = "The Type is annotated correctly, it just can't pass through the lambda method.")]
|
||||
|
|
|
@ -223,7 +223,7 @@ namespace System.Security.Cryptography.Pkcs
|
|||
SignedAttributesSet signedAttrsSet = default;
|
||||
signedAttrsSet.SignedAttributes = PkcsHelpers.NormalizeAttributeSet(
|
||||
signedAttrs.ToArray(),
|
||||
normalized => hasher.AppendData(normalized));
|
||||
hasher.AppendData);
|
||||
|
||||
// Since this contains user data in a context where BER is permitted, use BER.
|
||||
// There shouldn't be any observable difference here between BER and DER, though,
|
||||
|
|
|
@ -117,8 +117,7 @@ namespace System.Security.Cryptography
|
|||
return ExportArray(
|
||||
passwordBytes,
|
||||
pbeParameters,
|
||||
(ReadOnlySpan<byte> span, PbeParameters parameters, Span<byte> destination, out int i) =>
|
||||
TryExportEncryptedPkcs8PrivateKey(span, parameters, destination, out i));
|
||||
TryExportEncryptedPkcs8PrivateKey);
|
||||
}
|
||||
|
||||
public virtual byte[] ExportEncryptedPkcs8PrivateKey(
|
||||
|
@ -128,17 +127,16 @@ namespace System.Security.Cryptography
|
|||
return ExportArray(
|
||||
password,
|
||||
pbeParameters,
|
||||
(ReadOnlySpan<char> span, PbeParameters parameters, Span<byte> destination, out int i) =>
|
||||
TryExportEncryptedPkcs8PrivateKey(span, parameters, destination, out i));
|
||||
TryExportEncryptedPkcs8PrivateKey);
|
||||
}
|
||||
|
||||
public virtual byte[] ExportPkcs8PrivateKey() =>
|
||||
ExportArray(
|
||||
(Span<byte> destination, out int i) => TryExportPkcs8PrivateKey(destination, out i));
|
||||
TryExportPkcs8PrivateKey);
|
||||
|
||||
public virtual byte[] ExportSubjectPublicKeyInfo() =>
|
||||
ExportArray(
|
||||
(Span<byte> destination, out int i) => TryExportSubjectPublicKeyInfo(destination, out i));
|
||||
TryExportSubjectPublicKeyInfo);
|
||||
|
||||
public virtual bool TryExportEncryptedPkcs8PrivateKey(
|
||||
ReadOnlySpan<byte> passwordBytes,
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace System.Security.Cryptography.X509Certificates
|
|||
/// </summary>
|
||||
public static ECDsa? GetECDsaPublicKey(this X509Certificate2 certificate)
|
||||
{
|
||||
return certificate.GetPublicKey<ECDsa>(cert => HasECDsaKeyUsage(cert));
|
||||
return certificate.GetPublicKey<ECDsa>(HasECDsaKeyUsage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -24,7 +24,7 @@ namespace System.Security.Cryptography.X509Certificates
|
|||
/// </summary>
|
||||
public static ECDsa? GetECDsaPrivateKey(this X509Certificate2 certificate)
|
||||
{
|
||||
return certificate.GetPrivateKey<ECDsa>(cert => HasECDsaKeyUsage(cert));
|
||||
return certificate.GetPrivateKey<ECDsa>(HasECDsaKeyUsage);
|
||||
}
|
||||
|
||||
public static X509Certificate2 CopyWithPrivateKey(this X509Certificate2 certificate, ECDsa privateKey)
|
||||
|
|
|
@ -89,8 +89,8 @@ namespace System.Security.Cryptography.X509Certificates
|
|||
{
|
||||
Interop.Crypto.CheckValidOpenSslHandle(pkcs7);
|
||||
return Interop.Crypto.OpenSslEncode(
|
||||
handle => Interop.Crypto.GetPkcs7DerSize(handle),
|
||||
(handle, buf) => Interop.Crypto.EncodePkcs7(handle, buf),
|
||||
Interop.Crypto.GetPkcs7DerSize,
|
||||
Interop.Crypto.EncodePkcs7,
|
||||
pkcs7);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -376,8 +376,8 @@ namespace System.Security.Cryptography.X509Certificates
|
|||
get
|
||||
{
|
||||
return Interop.Crypto.OpenSslEncode(
|
||||
x => Interop.Crypto.GetX509DerSize(x),
|
||||
(x, buf) => Interop.Crypto.EncodeX509(x, buf),
|
||||
Interop.Crypto.GetX509DerSize,
|
||||
Interop.Crypto.EncodeX509,
|
||||
_cert);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -760,8 +760,8 @@ namespace System.Security.Cryptography.X509Certificates
|
|||
using (SafeOcspRequestHandle req = Interop.Crypto.X509ChainBuildOcspRequest(_storeCtx, chainDepth))
|
||||
{
|
||||
ArraySegment<byte> encoded = Interop.Crypto.OpenSslRentEncode(
|
||||
handle => Interop.Crypto.GetOcspRequestDerSize(handle),
|
||||
(handle, buf) => Interop.Crypto.EncodeOcspRequest(handle, buf),
|
||||
Interop.Crypto.GetOcspRequestDerSize,
|
||||
Interop.Crypto.EncodeOcspRequest,
|
||||
req);
|
||||
|
||||
ArraySegment<char> urlEncoded = UrlBase64Encoding.RentEncode(encoded);
|
||||
|
@ -1303,7 +1303,7 @@ namespace System.Security.Cryptography.X509Certificates
|
|||
{
|
||||
return s_errorStrings.GetOrAdd(
|
||||
code.Code,
|
||||
c => Interop.Crypto.GetX509VerifyCertErrorString(c));
|
||||
Interop.Crypto.GetX509VerifyCertErrorString);
|
||||
}
|
||||
|
||||
private sealed class WorkingChain : IDisposable
|
||||
|
|
|
@ -701,7 +701,7 @@ namespace System.Security.Cryptography.X509Certificates
|
|||
/// </exception>
|
||||
public ECDiffieHellman? GetECDiffieHellmanPublicKey()
|
||||
{
|
||||
return this.GetPublicKey<ECDiffieHellman>(cert => HasECDiffieHellmanKeyUsage(cert));
|
||||
return this.GetPublicKey<ECDiffieHellman>(HasECDiffieHellmanKeyUsage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -716,7 +716,7 @@ namespace System.Security.Cryptography.X509Certificates
|
|||
/// </exception>
|
||||
public ECDiffieHellman? GetECDiffieHellmanPrivateKey()
|
||||
{
|
||||
return this.GetPrivateKey<ECDiffieHellman>(cert => HasECDiffieHellmanKeyUsage(cert));
|
||||
return this.GetPrivateKey<ECDiffieHellman>(HasECDiffieHellmanKeyUsage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -159,8 +159,8 @@ namespace System.ServiceModel.Syndication
|
|||
{
|
||||
SyndicationFeedFormatter.MoveToStartElement(reader);
|
||||
SetDocument(AtomPub10ServiceDocumentFormatter.ReadCategories(reader, null,
|
||||
() => CreateInlineCategoriesDocument(),
|
||||
() => CreateReferencedCategoriesDocument(),
|
||||
CreateInlineCategoriesDocument,
|
||||
CreateReferencedCategoriesDocument,
|
||||
Version,
|
||||
_maxExtensionSize));
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace System.Speech.Internal.SapiInterop
|
|||
|
||||
internal void DisposeEventNotify(EventNotify eventNotify)
|
||||
{
|
||||
_proxy.Invoke2(delegate { eventNotify.Dispose(); });
|
||||
_proxy.Invoke2(eventNotify.Dispose);
|
||||
}
|
||||
|
||||
internal void SetGrammarOptions(SPGRAMMAROPTIONS options)
|
||||
|
|
|
@ -552,7 +552,7 @@ namespace System.Text.Json.SourceGeneration
|
|||
return typeGenerationSpec;
|
||||
}
|
||||
|
||||
internal static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is ClassDeclarationSyntax { AttributeLists: { Count: > 0 }, BaseList: { Types : {Count : > 0 } } };
|
||||
internal static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is ClassDeclarationSyntax { AttributeLists.Count: > 0, BaseList.Types.Count: > 0 };
|
||||
|
||||
internal static ClassDeclarationSyntax? GetSemanticTargetForGeneration(GeneratorSyntaxContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1365,7 +1365,7 @@ namespace System.Text.RegularExpressions.Generator
|
|||
{
|
||||
int numChars = RegexCharClass.GetSetChars(childStart.Str!, setChars);
|
||||
Debug.Assert(numChars != 0);
|
||||
writer.WriteLine($"case {string.Join(" or ", setChars.Slice(0, numChars).ToArray().Select(c => Literal(c)))}:");
|
||||
writer.WriteLine($"case {string.Join(" or ", setChars.Slice(0, numChars).ToArray().Select(Literal))}:");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace System.Text.RegularExpressions.Generator
|
|||
|
||||
private static bool IsSyntaxTargetForGeneration(SyntaxNode node, CancellationToken cancellationToken) =>
|
||||
// We don't have a semantic model here, so the best we can do is say whether there are any attributes.
|
||||
node is MethodDeclarationSyntax { AttributeLists: { Count: > 0 } };
|
||||
node is MethodDeclarationSyntax { AttributeLists.Count: > 0 };
|
||||
|
||||
private static bool IsSemanticTargetForGeneration(SemanticModel semanticModel, MethodDeclarationSyntax methodDeclarationSyntax, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace System.Threading.Tasks.Dataflow
|
|||
onItemsRemoved, itemCountingFunc);
|
||||
|
||||
// Initialize target
|
||||
_target = new BatchBlockTargetCore(this, batchSize, batch => _source.AddMessage(batch), dataflowBlockOptions);
|
||||
_target = new BatchBlockTargetCore(this, batchSize, _source.AddMessage, dataflowBlockOptions);
|
||||
|
||||
// When the target is done, let the source know it won't be getting any more data
|
||||
_target.Completion.ContinueWith(delegate { _source.Complete(); },
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace System.Reflection.Metadata
|
|||
|
||||
public static bool IsSupported { get; } = ApplyUpdateEnabled(justComponentCheck: 0) != 0;
|
||||
|
||||
private static Lazy<string> s_ApplyUpdateCapabilities = new Lazy<string>(() => InitializeApplyUpdateCapabilities());
|
||||
private static readonly Lazy<string> s_ApplyUpdateCapabilities = new Lazy<string>(InitializeApplyUpdateCapabilities);
|
||||
|
||||
private static string InitializeApplyUpdateCapabilities()
|
||||
{
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace Microsoft.WebAssembly.Diagnostics
|
|||
if (request == null || store == null)
|
||||
return false;
|
||||
|
||||
return store.AllSources().FirstOrDefault(source => TryResolve(source)) != null;
|
||||
return store.AllSources().FirstOrDefault(TryResolve) != null;
|
||||
}
|
||||
|
||||
public bool CompareRequest(JObject req)
|
||||
|
|
|
@ -522,7 +522,7 @@ public class MonoAOTCompiler : Microsoft.Build.Utilities.Task
|
|||
ParallelLoopResult result = Parallel.ForEach(
|
||||
Partitioner.Create(argsList, EnumerablePartitionerOptions.NoBuffering),
|
||||
new ParallelOptions { MaxDegreeOfParallelism = allowedParallelism },
|
||||
(args, state) => PrecompileLibraryParallel(args, state));
|
||||
PrecompileLibraryParallel);
|
||||
|
||||
if (result.IsCompleted)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue