From bc5809c0745f6f3b1339bd99bb14667b71c89e0a Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Wed, 1 Jun 2022 23:58:42 -0700 Subject: [PATCH 1/3] Update analyzer version and fix new findings --- eng/CodeAnalysis.src.globalconfig | 3 +++ eng/CodeAnalysis.test.globalconfig | 3 +++ eng/Versions.props | 2 +- .../src/Microsoft/Win32/SystemEvents.cs | 8 ++++---- .../Microsoft.XmlSerializer.Generator/src/Sgen.cs | 4 +--- .../AttributedModel/AttributedExportDefinition.cs | 4 ++-- .../System/Configuration/ConfigurationElement.cs | 4 ++-- .../System.Data.Common/src/System/Data/XMLSchema.cs | 8 ++++---- .../System/Data/Common/DbConnectionOptions.cs | 8 ++++---- .../System.Data.OleDb/src/System.Data.OleDb.csproj | 4 ++-- .../AccountManagement/AD/ADStoreCtx_Query.cs | 7 +++---- .../src/System.Drawing.Common.csproj | 1 + .../src/System/IO/Packaging/Package.cs | 8 ++++---- .../src/System/IO/Packaging/ZipPackage.cs | 13 ++++++------- .../src/System/Xml/Dom/XmlNodeReader.cs | 2 +- .../src/Internal/SrgsCompiler/BackEnd.cs | 2 +- 16 files changed, 42 insertions(+), 39 deletions(-) diff --git a/eng/CodeAnalysis.src.globalconfig b/eng/CodeAnalysis.src.globalconfig index 839a4e0f4a1d59..77329e9d02a56b 100644 --- a/eng/CodeAnalysis.src.globalconfig +++ b/eng/CodeAnalysis.src.globalconfig @@ -411,6 +411,9 @@ dotnet_diagnostic.CA1852.severity = warning # CA1853: Unnecessary call to 'Dictionary.ContainsKey(key)' dotnet_diagnostic.CA1853.severity = warning +# CA1854: Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method +dotnet_diagnostic.CA1854.severity = warning + # CA2000: Dispose objects before losing scope dotnet_diagnostic.CA2000.severity = none diff --git a/eng/CodeAnalysis.test.globalconfig b/eng/CodeAnalysis.test.globalconfig index 97bf6113e88e76..59fc4e0022deba 100644 --- a/eng/CodeAnalysis.test.globalconfig +++ b/eng/CodeAnalysis.test.globalconfig @@ -408,6 +408,9 @@ dotnet_diagnostic.CA1852.severity = none # CA1853: Unnecessary call to 'Dictionary.ContainsKey(key)' dotnet_diagnostic.CA1853.severity = none +# CA1854: Prefer the 'IDictionary.TryGetValue(TKey, out TValue)' method +dotnet_diagnostic.CA1854.severity = none + # CA2000: Dispose objects before losing scope dotnet_diagnostic.CA2000.severity = none diff --git a/eng/Versions.props b/eng/Versions.props index 1eea1923b3117f..21b98d3ef92622 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,7 +44,7 @@ 4.3.0-1.22206.2 4.3.0-1.22206.2 4.3.0-1.22206.2 - 7.0.0-preview1.22252.2 + 7.0.0-preview1.22301.1 4.3.0-1.22206.2 - $(NoWarn);CA2249 + $(NoWarn);CA2249;CA1420 $(NoWarn);SYSLIB0004 diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs index 1561394861ffd1..341cd7db217d03 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs @@ -44,11 +44,10 @@ private void BuildExtensionPropertyList(Hashtable propertyList, Type p) protected void BuildPropertySet(Type p, StringCollection propertySet) { - if (TypeToLdapPropListMap[this.MappingTableIndex].ContainsKey(p)) + if (TypeToLdapPropListMap[this.MappingTableIndex].TryGetValue(p, out var value)) { - Debug.Assert(TypeToLdapPropListMap[this.MappingTableIndex].ContainsKey(p)); - string[] props = new string[TypeToLdapPropListMap[this.MappingTableIndex][p].Count]; - TypeToLdapPropListMap[this.MappingTableIndex][p].CopyTo(props, 0); + string[] props = new string[value.Count]; + value.CopyTo(props, 0); propertySet.AddRange(props); } else diff --git a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj index df9c7ef864aede..e25e0cafbdf6b4 100644 --- a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj @@ -4,6 +4,7 @@ $(DefineConstants);DRAWING_NAMESPACE true CS0618 + $(NoWarn);CA1420 true true true diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs index d1d3f031a3b900..9851e8f517e086 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs @@ -316,12 +316,12 @@ public void DeletePart(Uri partUri) PackUriHelper.ValidatedPartUri validatedPartUri = (PackUriHelper.ValidatedPartUri)PackUriHelper.ValidatePartUri(partUri); - if (_partList.ContainsKey(validatedPartUri)) + if (_partList.TryGetValue(validatedPartUri, out var value)) { //This will get the actual casing of the part that //is stored in the partList which is equivalent to the //partUri provided by the user - validatedPartUri = (PackUriHelper.ValidatedPartUri)_partList[validatedPartUri].Uri; + validatedPartUri = (PackUriHelper.ValidatedPartUri)value.Uri; _partList[validatedPartUri].IsDeleted = true; _partList[validatedPartUri].Close(); @@ -1125,9 +1125,9 @@ private bool DoCloseRelationshipsXml(PackagePart p) PackUriHelper.ValidatedPartUri validatePartUri = PackUriHelper.ValidatePartUri(partUri); - if (_partList.ContainsKey(validatePartUri)) + if (_partList.TryGetValue(validatePartUri, out var value)) { - return _partList[validatePartUri]; + return value; } else { diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs index d8b6a25a462b23..841b367b1bd3a5 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs @@ -606,9 +606,8 @@ internal void AddContentType(PackUriHelper.ValidatedPartUri partUri, ContentType // Need to create an override entry? if (extension.Length == 0 - || (_defaultDictionary.ContainsKey(extension) - && !(foundMatchingDefault = - _defaultDictionary[extension].AreTypeAndSubTypeEqual(contentType)))) + || (_defaultDictionary.TryGetValue(extension, out var value) + && !(foundMatchingDefault = value.AreTypeAndSubTypeEqual(contentType)))) { AddOverrideElement(partUri, contentType); } @@ -629,16 +628,16 @@ internal void AddContentType(PackUriHelper.ValidatedPartUri partUri, ContentType //partUri provided. Override takes precedence over the default entries if (_overrideDictionary != null) { - if (_overrideDictionary.ContainsKey(partUri)) - return _overrideDictionary[partUri]; + if (_overrideDictionary.TryGetValue(partUri, out var val)) + return val; } //Step 2: Check if there is a default entry corresponding to the //extension of the partUri provided. string extension = partUri.PartUriExtension; - if (_defaultDictionary.ContainsKey(extension)) - return _defaultDictionary[extension]; + if (_defaultDictionary.TryGetValue(extension, out var value)) + return value; //Step 3: If we did not find an entry in the override and the default //dictionaries, this is an error condition diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs index 8c660bc7d0c84e..8e869cca5f7391 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs @@ -1027,7 +1027,7 @@ internal IDictionary GetNamespacesInScope(XmlNamespaceScope scop if (scope != XmlNamespaceScope.Local) { - if (dict.ContainsKey(string.Empty) && dict[string.Empty] == string.Empty) + if (dict.TryGetValue(string.Empty, out var value) && value == string.Empty) { dict.Remove(string.Empty); } diff --git a/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs b/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs index 0f678c5c0f209c..74898b42caa6a6 100644 --- a/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs +++ b/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs @@ -342,7 +342,7 @@ internal Rule FindRule(string sRule) System.Diagnostics.Debug.Assert(dwSymbolOffset == 0 || _symbols[iWord] == sRule); - rule = dwSymbolOffset > 0 && _nameOffsetRules.ContainsKey(dwSymbolOffset) ? _nameOffsetRules[dwSymbolOffset] : null; + rule = dwSymbolOffset > 0 && _nameOffsetRules.TryGetValue(dwSymbolOffset, out var value) ? value : null; } } From e93bb4658d4b6a50dc8af037fc088d42bab2b181 Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Thu, 2 Jun 2022 11:46:53 -0700 Subject: [PATCH 2/3] Update var to exact type --- .../managed/Microsoft.NET.HostModel/ComHost/ClsidMap.cs | 4 ++-- .../src/Microsoft/Win32/SystemEvents.cs | 8 ++------ .../Microsoft.XmlSerializer.Generator/src/Sgen.cs | 2 +- .../AttributedModel/AttributedExportDefinition.cs | 2 +- .../src/System/Configuration/ConfigurationElement.cs | 2 +- .../System.Data.Common/src/System/Data/XMLSchema.cs | 4 ++-- .../src/Common/System/Data/Common/DbConnectionOptions.cs | 5 ++--- .../AccountManagement/AD/ADStoreCtx_Query.cs | 2 +- .../src/System/IO/Packaging/Package.cs | 4 ++-- .../src/System/IO/Packaging/ZipPackage.cs | 6 +++--- .../src/System/Xml/Dom/XmlNodeReader.cs | 2 +- .../System.Speech/src/Internal/SrgsCompiler/BackEnd.cs | 2 +- 12 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/installer/managed/Microsoft.NET.HostModel/ComHost/ClsidMap.cs b/src/installer/managed/Microsoft.NET.HostModel/ComHost/ClsidMap.cs index 9864f8f599f30a..a8cbb02294ea23 100644 --- a/src/installer/managed/Microsoft.NET.HostModel/ComHost/ClsidMap.cs +++ b/src/installer/managed/Microsoft.NET.HostModel/ComHost/ClsidMap.cs @@ -46,9 +46,9 @@ public static void Create(MetadataReader metadataReader, string clsidMapPath) Guid guid = GetTypeGuid(metadataReader, definition); string guidString = GetTypeGuid(metadataReader, definition).ToString("B"); - if (clsidMap.ContainsKey(guidString)) + if (clsidMap.TryGetValue(guidString, out ClsidEntry value)) { - throw new ConflictingGuidException(clsidMap[guidString].Type, GetTypeName(metadataReader, definition), guid); + throw new ConflictingGuidException(value.Type, GetTypeName(metadataReader, definition), guid); } string progId = GetProgId(metadataReader, definition); diff --git a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs index 6df6a627dea690..3cccd9a40c19ed 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs +++ b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs @@ -1004,10 +1004,8 @@ private static void RaiseEvent(bool checkFinalization, object key, params object lock (s_eventLockObject) { - if (s_handlers != null && s_handlers.TryGetValue(key, out var value)) + if (s_handlers != null && s_handlers.TryGetValue(key, out List? invokeItems)) { - List invokeItems = value; - // clone the list so we don't have this type locked and cause // a deadlock if someone tries to modify handlers during an invoke. if (invokeItems != null) @@ -1068,10 +1066,8 @@ private static void RemoveEventHandler(object key, Delegate? value) lock (s_eventLockObject) { - if (s_handlers != null && s_handlers.TryGetValue(key, out var val)) + if (s_handlers != null && s_handlers.TryGetValue(key, out List? invokeItems)) { - List invokeItems = val; - invokeItems.Remove(new SystemEventInvokeInfo(value)); } } diff --git a/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs b/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs index dd48ddf61833db..4f4865753a1b4d 100644 --- a/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs +++ b/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs @@ -618,7 +618,7 @@ private static Assembly SgenAssemblyResolver(object source, ResolveEventArgs e) return null; } - if (s_referencedic.TryGetValue(assemblyname, out var reference)) + if (s_referencedic.TryGetValue(assemblyname, out string reference)) { // For System.ServiceModel.Primitives, we need to load its runtime assembly rather than reference assembly if (assemblyname.Equals("System.ServiceModel.Primitives")) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs index 203729985e0658..b7c23cc6e85117 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs @@ -46,7 +46,7 @@ public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, M metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, typeIdentity); var partMetadata = _partCreationInfo.GetMetadata(); - if (partMetadata != null && partMetadata.TryGetValue(CompositionConstants.PartCreationPolicyMetadataName, out var value)) + if (partMetadata != null && partMetadata.TryGetValue(CompositionConstants.PartCreationPolicyMetadataName, out object? value)) { metadata.Add(CompositionConstants.PartCreationPolicyMetadataName, value); } diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs index 7e07321426862b..5ae370cd7ae6ec 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs @@ -835,7 +835,7 @@ private static void ApplyValidator(ConfigurationElement elem) { Debug.Assert(elem != null); - if ((s_perTypeValidators != null) && s_perTypeValidators.TryGetValue(elem.GetType(), out var value)) + if ((s_perTypeValidators != null) && s_perTypeValidators.TryGetValue(elem.GetType(), out ConfigurationValidatorBase value)) elem._elementProperty = new ConfigurationElementProperty(value); } diff --git a/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs b/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs index 2028bde75c7a44..83434330b1a44e 100644 --- a/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs +++ b/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs @@ -1349,7 +1349,7 @@ internal void HandleKeyref(XmlSchemaKeyref keyref) if (FromInference && relation.Nested) { - if (_tableDictionary!.TryGetValue(relation.ParentTable, out var value)) + if (_tableDictionary!.TryGetValue(relation.ParentTable, out List? value)) { value.Add(relation.ChildTable); } @@ -1762,7 +1762,7 @@ internal DataTable InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType _tableChild.DataSet!.Relations.Add(relation); if (FromInference && relation.Nested) { - if (_tableDictionary!.TryGetValue(relation.ParentTable, out var value)) + if (_tableDictionary!.TryGetValue(relation.ParentTable, out List? value)) { value.Add(relation.ChildTable); } diff --git a/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs b/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs index a763d5393cab96..3aa0aa56b7f1b8 100644 --- a/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs +++ b/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs @@ -77,12 +77,11 @@ internal bool HasBlankPassword { if (!ConvertValueToIntegratedSecurity()) { - if (_parsetable.TryGetValue(KEY.Password, out var value)) + if (_parsetable.TryGetValue(KEY.Password, out string? value)) { return string.IsNullOrEmpty(value); } - else - if (_parsetable.TryGetValue(SYNONYM.Pwd, out var val)) + else if (_parsetable.TryGetValue(SYNONYM.Pwd, out string? val)) { return string.IsNullOrEmpty(val); // MDAC 83097 } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs index 341cd7db217d03..25f3bb87f26923 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs @@ -44,7 +44,7 @@ private void BuildExtensionPropertyList(Hashtable propertyList, Type p) protected void BuildPropertySet(Type p, StringCollection propertySet) { - if (TypeToLdapPropListMap[this.MappingTableIndex].TryGetValue(p, out var value)) + if (TypeToLdapPropListMap[this.MappingTableIndex].TryGetValue(p, out StringCollection value)) { string[] props = new string[value.Count]; value.CopyTo(props, 0); diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs index 9851e8f517e086..1d33e5493e81f3 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs @@ -316,7 +316,7 @@ public void DeletePart(Uri partUri) PackUriHelper.ValidatedPartUri validatedPartUri = (PackUriHelper.ValidatedPartUri)PackUriHelper.ValidatePartUri(partUri); - if (_partList.TryGetValue(validatedPartUri, out var value)) + if (_partList.TryGetValue(validatedPartUri, out PackagePart? value)) { //This will get the actual casing of the part that //is stored in the partList which is equivalent to the @@ -1125,7 +1125,7 @@ private bool DoCloseRelationshipsXml(PackagePart p) PackUriHelper.ValidatedPartUri validatePartUri = PackUriHelper.ValidatePartUri(partUri); - if (_partList.TryGetValue(validatePartUri, out var value)) + if (_partList.TryGetValue(validatePartUri, out PackagePart? value)) { return value; } diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs index 841b367b1bd3a5..0427879d014994 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs @@ -606,7 +606,7 @@ internal void AddContentType(PackUriHelper.ValidatedPartUri partUri, ContentType // Need to create an override entry? if (extension.Length == 0 - || (_defaultDictionary.TryGetValue(extension, out var value) + || (_defaultDictionary.TryGetValue(extension, out ContentType? value) && !(foundMatchingDefault = value.AreTypeAndSubTypeEqual(contentType)))) { AddOverrideElement(partUri, contentType); @@ -628,7 +628,7 @@ internal void AddContentType(PackUriHelper.ValidatedPartUri partUri, ContentType //partUri provided. Override takes precedence over the default entries if (_overrideDictionary != null) { - if (_overrideDictionary.TryGetValue(partUri, out var val)) + if (_overrideDictionary.TryGetValue(partUri, out ContentType? val)) return val; } @@ -636,7 +636,7 @@ internal void AddContentType(PackUriHelper.ValidatedPartUri partUri, ContentType //extension of the partUri provided. string extension = partUri.PartUriExtension; - if (_defaultDictionary.TryGetValue(extension, out var value)) + if (_defaultDictionary.TryGetValue(extension, out ContentType? value)) return value; //Step 3: If we did not find an entry in the override and the default diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs index 8e869cca5f7391..15de351a67742e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs @@ -1027,7 +1027,7 @@ internal IDictionary GetNamespacesInScope(XmlNamespaceScope scop if (scope != XmlNamespaceScope.Local) { - if (dict.TryGetValue(string.Empty, out var value) && value == string.Empty) + if (dict.TryGetValue(string.Empty, out string? value) && value == string.Empty) { dict.Remove(string.Empty); } diff --git a/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs b/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs index 74898b42caa6a6..6d0c8d94f487ce 100644 --- a/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs +++ b/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs @@ -342,7 +342,7 @@ internal Rule FindRule(string sRule) System.Diagnostics.Debug.Assert(dwSymbolOffset == 0 || _symbols[iWord] == sRule); - rule = dwSymbolOffset > 0 && _nameOffsetRules.TryGetValue(dwSymbolOffset, out var value) ? value : null; + rule = dwSymbolOffset > 0 && _nameOffsetRules.TryGetValue(dwSymbolOffset, out Rule value) ? value : null; } } From 9c20d685aee3e5a755180012dd8907c3c5bdc69e Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Thu, 9 Jun 2022 10:48:56 -0700 Subject: [PATCH 3/3] Revert unneeded change --- src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj index c13b531a1f7c62..ef2c702bc4c01a 100644 --- a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj +++ b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj @@ -1,4 +1,4 @@ - + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true