diff --git a/eng/Versions.props b/eng/Versions.props index 5ffab98bd928a517be93884e36da417a0cfe7d42..61c2571a0508ca958b7c6ef49eb665cac5d5fe26 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -27,7 +27,7 @@ - 2.9.4 + 2.9.5 2.8.2 1.0.0-beta1-63310-01 3.3.1-beta3-19454-05 diff --git a/eng/config/rulesets/NonShipping.ruleset b/eng/config/rulesets/NonShipping.ruleset index d2c0144fdadc31145467ab2140ef2d383e475676..be83f203627e3443bfe52eb1cad8604e86e20614 100644 --- a/eng/config/rulesets/NonShipping.ruleset +++ b/eng/config/rulesets/NonShipping.ruleset @@ -21,6 +21,9 @@ + + + diff --git a/src/Compilers/Core/Portable/Collections/SmallDictionary.cs b/src/Compilers/Core/Portable/Collections/SmallDictionary.cs index c6e2995a0a409963345cec17d7bb52b26faec05b..3b8c52ffef58b3967583c005d6381c5ec50e4727 100644 --- a/src/Compilers/Core/Portable/Collections/SmallDictionary.cs +++ b/src/Compilers/Core/Portable/Collections/SmallDictionary.cs @@ -276,7 +276,9 @@ private void Insert(int hashCode, K key, V value, bool add) { if (currentNode.Left == null) { - currentNode.Left = currentNode = new AvlNode(hashCode, key, value); + var previousNode = currentNode; + currentNode = new AvlNode(hashCode, key, value); + previousNode.Left = currentNode; break; } @@ -287,7 +289,9 @@ private void Insert(int hashCode, K key, V value, bool add) { if (currentNode.Right == null) { - currentNode.Right = currentNode = new AvlNode(hashCode, key, value); + var previousNode = currentNode; + currentNode = new AvlNode(hashCode, key, value); + previousNode.Right = currentNode; break; } diff --git a/src/Compilers/Core/Portable/Operations/ControlFlowGraph.cs b/src/Compilers/Core/Portable/Operations/ControlFlowGraph.cs index 326b6b40aa7ed789df80d9732cd49cc16397ff30..798bb9edf2c37202dc850eac4e3847298fb92448 100644 --- a/src/Compilers/Core/Portable/Operations/ControlFlowGraph.cs +++ b/src/Compilers/Core/Portable/Operations/ControlFlowGraph.cs @@ -45,7 +45,7 @@ public sealed partial class ControlFlowGraph Debug.Assert(!localFunctions.IsDefault); Debug.Assert(localFunctionsMap != null); Debug.Assert(localFunctionsMap.Count == localFunctions.Length); - Debug.Assert(localFunctions.Distinct().Count() == localFunctions.Length); + Debug.Assert(localFunctions.Distinct().Length == localFunctions.Length); Debug.Assert(anonymousFunctionsMap != null); #if DEBUG foreach (IMethodSymbol method in localFunctions) diff --git a/src/Compilers/VisualBasic/Portable/Binding/Binder_Latebound.vb b/src/Compilers/VisualBasic/Portable/Binding/Binder_Latebound.vb index e28c76b989dcbae955bb5ee177cad02450b72fe0..0ec9ea35920f13f54efdfaeffa2db992d91f897c 100644 --- a/src/Compilers/VisualBasic/Portable/Binding/Binder_Latebound.vb +++ b/src/Compilers/VisualBasic/Portable/Binding/Binder_Latebound.vb @@ -233,7 +233,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Debug.Assert(Not arguments.IsDefault) - If argumentNames.IsDefault OrElse argumentNames.Count = 0 Then + If argumentNames.IsDefault OrElse argumentNames.Length = 0 Then Return End If @@ -242,7 +242,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic End If Dim seenName As Boolean = False - For i As Integer = 0 To argumentNames.Count - 1 + For i As Integer = 0 To argumentNames.Length - 1 If argumentNames(i) IsNot Nothing Then seenName = True diff --git a/src/Compilers/VisualBasic/Portable/Lowering/UseTwiceRewriter.vb b/src/Compilers/VisualBasic/Portable/Lowering/UseTwiceRewriter.vb index 8468cdfa2b3f1a27c8899d18d232c7b3e2f01ddb..58b3012b74d72ecff67e80b4eacdbdb9ecfe7dc8 100644 --- a/src/Compilers/VisualBasic/Portable/Lowering/UseTwiceRewriter.vb +++ b/src/Compilers/VisualBasic/Portable/Lowering/UseTwiceRewriter.vb @@ -223,7 +223,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Dim boundArrayTemp As BoundLocal = Nothing Dim storeArray = CaptureInATemp(containingMember, node.Expression, arg, boundArrayTemp) - Dim n = node.Indices.Count + Dim n = node.Indices.Length Dim indicesFirst(n - 1) As BoundExpression Dim indicesSecond(n - 1) As BoundExpression diff --git a/src/Compilers/VisualBasic/Portable/Semantics/Conversions.vb b/src/Compilers/VisualBasic/Portable/Semantics/Conversions.vb index 924c19a8a420f14686fc3be72124317e51f1db2b..ae5ef0fa09eb327ab88f011b6d8fd9be0ef4d5f7 100644 --- a/src/Compilers/VisualBasic/Portable/Semantics/Conversions.vb +++ b/src/Compilers/VisualBasic/Portable/Semantics/Conversions.vb @@ -1260,7 +1260,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic End If Dim targetElementTypes As ImmutableArray(Of TypeSymbol) = destination.GetElementTypesOfTupleOrCompatible() - Debug.Assert(arguments.Count = targetElementTypes.Length) + Debug.Assert(arguments.Length = targetElementTypes.Length) ' check arguments against flattened list of target element types Dim result As ConversionKind = wideningConversion @@ -3576,7 +3576,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic End If Dim targetElementTypes As ImmutableArray(Of TypeSymbol) = destination.GetElementTypesOfTupleOrCompatible() - Debug.Assert(sourceElementTypes.Count = targetElementTypes.Length) + Debug.Assert(sourceElementTypes.Length = targetElementTypes.Length) ' check arguments against flattened list of target element types Dim result As ConversionKind = ConversionKind.WideningTuple diff --git a/src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/CRC32.vb b/src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/CRC32.vb index 7217590691c0e2682181edb50653b754679ee3f7..0383445950eee3c49e16edcdd5ea6553446aeb34 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/CRC32.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/AnonymousTypes/CRC32.vb @@ -11,7 +11,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols Friend Module CRC32 Public Function ComputeCRC32(names() As String) As UInt32 - Debug.Assert(names.Count > 0) + Debug.Assert(names.Length > 0) Dim crc32 As UInt32 = &HFFFFFFFF For Each name In names diff --git a/src/Compilers/VisualBasic/Portable/Symbols/MergedNamespaceSymbol.vb b/src/Compilers/VisualBasic/Portable/Symbols/MergedNamespaceSymbol.vb index 36cf3765ca37a82e0448e53e701ff7633e6d46c0..1e8f2fa4dfece1fd96eb648c0108d7670b586fbb 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/MergedNamespaceSymbol.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/MergedNamespaceSymbol.vb @@ -178,7 +178,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols ' Constructor. Use static Create method to create instances. Private Sub New(containingNamespace As MergedNamespaceSymbol, namespacesToMerge As ImmutableArray(Of NamespaceSymbol)) - Debug.Assert(namespacesToMerge.Distinct().Count() = namespacesToMerge.Length) + Debug.Assert(namespacesToMerge.Distinct().Length = namespacesToMerge.Length) Me._namespacesToMerge = namespacesToMerge Me._containingNamespace = containingNamespace diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/MemberRefMetadataDecoder.vb b/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/MemberRefMetadataDecoder.vb index 07f98b91cded6501c69c9d0dfb7a33854c77907a..42e5f79c9500df8acbff16c02f7620674a4fa53e 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/MemberRefMetadataDecoder.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Metadata/PE/MemberRefMetadataDecoder.vb @@ -251,7 +251,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols.Metadata.PE End If Dim n = candidateReturnTypeCustomModifiers.Length - If targetReturnTypeCustomModifiers.Count <> n Then + If targetReturnTypeCustomModifiers.Length <> n Then Return False End If diff --git a/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMemberMethodSymbol.vb b/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMemberMethodSymbol.vb index 2e03786289db092338f5cc622f865e112c2ae976..282db6ac56e4c685054910b67c6f781f90953da7 100644 --- a/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMemberMethodSymbol.vb +++ b/src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMemberMethodSymbol.vb @@ -1003,7 +1003,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols For Each attr In attrs If attr.AttributeClass Is compilation.GetWellKnownType(WellKnownType.System_ComponentModel_DesignerSerializationVisibilityAttribute) Then Dim args = attr.CommonConstructorArguments - If args.Count = 1 Then + If args.Length = 1 Then Dim arg = args(0) Const DESIGNERSERIALIZATIONVISIBILITYTYPE_CONTENT As Integer = 2 If arg.Kind <> TypedConstantKind.Array AndAlso CInt(arg.Value) = DESIGNERSERIALIZATIONVISIBILITYTYPE_CONTENT Then diff --git a/src/Compilers/VisualBasic/Portable/Syntax/VisualBasicSyntaxNode.vb b/src/Compilers/VisualBasic/Portable/Syntax/VisualBasicSyntaxNode.vb index 56005956f983b775c767c8d8ca83c8163c9ff527..a6bb33eecdf5173ed94cafd3e742193d3d904c14 100644 --- a/src/Compilers/VisualBasic/Portable/Syntax/VisualBasicSyntaxNode.vb +++ b/src/Compilers/VisualBasic/Portable/Syntax/VisualBasicSyntaxNode.vb @@ -214,7 +214,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic If node.ContainsDiagnostics Then Dim errors = DirectCast(node, Syntax.InternalSyntax.VisualBasicSyntaxNode).GetDiagnostics If errors IsNot Nothing Then - For i = 0 To errors.Count - 1 + For i = 0 To errors.Length - 1 Dim greenError = errors(i) Debug.Assert(greenError IsNot Nothing) errorList.Add(CreateSyntaxError(tree, nodeOrToken, greenError)) diff --git a/src/Features/CSharp/Portable/ChangeSignature/CSharpChangeSignatureService.cs b/src/Features/CSharp/Portable/ChangeSignature/CSharpChangeSignatureService.cs index dd848e6352c5707b94736d6c00aadc95797975f5..72402bf121c0548120f823d53f18a21b37d0c19d 100644 --- a/src/Features/CSharp/Portable/ChangeSignature/CSharpChangeSignatureService.cs +++ b/src/Features/CSharp/Portable/ChangeSignature/CSharpChangeSignatureService.cs @@ -526,7 +526,7 @@ private List VerifyAndPermuteParamNodes(IEnumerable CreateActions(State state, CancellationToken } } - Debug.Assert(actions.Count() != 0, "No code actions found for MoveType Refactoring"); + Debug.Assert(actions.Count != 0, "No code actions found for MoveType Refactoring"); return actions.ToImmutableArray(); } diff --git a/src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs b/src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs index d22634e42ca93941bcc628239eae1b537add23c8..824fed7e813be193eefd4371c82b30e68e74469a 100644 --- a/src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs +++ b/src/Features/Core/Portable/Diagnostics/AnalyzerHelper.cs @@ -441,13 +441,13 @@ async Task> ComputeDiagnosticAnalyzerDiagnosticsAsync() var diagnostics = await analyzerDriverOpt.GetAnalyzerSyntaxDiagnosticsAsync(tree, oneAnalyzers, cancellationToken).ConfigureAwait(false); LogSyntaxInfo(diagnostics, tree); - Debug.Assert(diagnostics.Count() == CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, analyzerDriverOpt.Compilation).Count()); + Debug.Assert(diagnostics.Length == CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, analyzerDriverOpt.Compilation).Count()); return diagnostics.ToImmutableArrayOrEmpty(); case AnalysisKind.Semantic: var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); diagnostics = await analyzerDriverOpt.GetAnalyzerSemanticDiagnosticsAsync(model, spanOpt, oneAnalyzers, cancellationToken).ConfigureAwait(false); - Debug.Assert(diagnostics.Count() == CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, analyzerDriverOpt.Compilation).Count()); + Debug.Assert(diagnostics.Length == CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, analyzerDriverOpt.Compilation).Count()); return diagnostics.ToImmutableArrayOrEmpty(); default: return Contract.FailWithReturn>("shouldn't reach here"); diff --git a/src/Features/Core/Portable/InitializeParameter/AbstractAddParameterCheckCodeRefactoringProvider.cs b/src/Features/Core/Portable/InitializeParameter/AbstractAddParameterCheckCodeRefactoringProvider.cs index dbc960066a5847a2caa09b9dde1a719370e17d1b..981bc8f87963f4f7bb41d2e7720e07a1597d3f66 100644 --- a/src/Features/Core/Portable/InitializeParameter/AbstractAddParameterCheckCodeRefactoringProvider.cs +++ b/src/Features/Core/Portable/InitializeParameter/AbstractAddParameterCheckCodeRefactoringProvider.cs @@ -50,7 +50,7 @@ internal abstract partial class AbstractAddParameterCheckCodeRefactoringProvider } // Min 2 parameters to offer the refactoring - if (listOfParametersOrdinals.Count() < 2) + if (listOfParametersOrdinals.Count < 2) { return ImmutableArray.Empty; } diff --git a/src/Features/Core/Portable/NavigateTo/AbstractNavigateToSearchService.InProcess.cs b/src/Features/Core/Portable/NavigateTo/AbstractNavigateToSearchService.InProcess.cs index 122301ac42cde7395957940431aa3ffb493632a6..fa589d8ab621233b9cda6c2e3e17eeedf9fa8279 100644 --- a/src/Features/Core/Portable/NavigateTo/AbstractNavigateToSearchService.InProcess.cs +++ b/src/Features/Core/Portable/NavigateTo/AbstractNavigateToSearchService.InProcess.cs @@ -174,7 +174,7 @@ internal abstract partial class AbstractNavigateToSearchService Debug.Assert(priorityDocuments.All(d => project.ContainsDocument(d.Id)), "Priority docs included doc not from project."); Debug.Assert(orderedDocs.Length == project.Documents.Count(), "Didn't have the same number of project after ordering them!"); - Debug.Assert(orderedDocs.Distinct().Count() == orderedDocs.Count(), "Ordered list contained a duplicate!"); + Debug.Assert(orderedDocs.Distinct().Length == orderedDocs.Length, "Ordered list contained a duplicate!"); Debug.Assert(project.Documents.All(d => orderedDocs.Contains(d)), "At least one document from the project was missing from the ordered list!"); foreach (var document in orderedDocs) diff --git a/src/Features/VisualBasic/Portable/ChangeSignature/VisualBasicChangeSignatureService.vb b/src/Features/VisualBasic/Portable/ChangeSignature/VisualBasicChangeSignatureService.vb index 69482ea88520ac96b2ca81af22a18dbd3c4e74a5..30956e727ef49cdc83a660cc00d6931af8023b97 100644 --- a/src/Features/VisualBasic/Portable/ChangeSignature/VisualBasicChangeSignatureService.vb +++ b/src/Features/VisualBasic/Portable/ChangeSignature/VisualBasicChangeSignatureService.vb @@ -458,7 +458,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ChangeSignature Dim reorderedParameters = updatedSignature.UpdatedConfiguration.ToListOfParameters() Dim declaredParameters = declarationSymbol.GetParameters() - If paramNodes.Count() <> declaredParameters.Count() Then + If paramNodes.Count() <> declaredParameters.Length Then Return Nothing End If diff --git a/src/Features/VisualBasic/Portable/GenerateType/VisualBasicGenerateTypeService.vb b/src/Features/VisualBasic/Portable/GenerateType/VisualBasicGenerateTypeService.vb index aa386f20a3ac0af0d73c8c2ea488894474bbee35..d62ad3950a2c4fe1cbc9ed4444b7bd9aae39dd85 100644 --- a/src/Features/VisualBasic/Portable/GenerateType/VisualBasicGenerateTypeService.vb +++ b/src/Features/VisualBasic/Portable/GenerateType/VisualBasicGenerateTypeService.vb @@ -360,7 +360,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.GenerateType End If Dim memberGroup = semanticModel.GetMemberGroup(expression, cancellationToken) - If memberGroup.Count <> 0 Then + If memberGroup.Length <> 0 Then Return If(memberGroup.ElementAt(0).IsKind(SymbolKind.Method), DirectCast(memberGroup.ElementAt(0), IMethodSymbol), Nothing) End If diff --git a/src/Features/VisualBasic/Portable/SignatureHelp/GenericNameSignatureHelpProvider.vb b/src/Features/VisualBasic/Portable/SignatureHelp/GenericNameSignatureHelpProvider.vb index d3d6874860891ffd3a00aeda43737b465582cf9b..1432187e9d070a47b75a4edb77ab7f7c1568b37c 100644 --- a/src/Features/VisualBasic/Portable/SignatureHelp/GenericNameSignatureHelpProvider.vb +++ b/src/Features/VisualBasic/Portable/SignatureHelp/GenericNameSignatureHelpProvider.vb @@ -98,7 +98,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.SignatureHelp FilterToVisibleAndBrowsableSymbolsAndNotUnsafeSymbols(document.ShouldHideAdvancedMembers(), semanticModel.Compilation). Sort(symbolDisplayService, semanticModel, genericName.SpanStart) - If accessibleSymbols.Count = 0 Then + If accessibleSymbols.Length = 0 Then Return Nothing End If diff --git a/src/Features/VisualBasic/Portable/SignatureHelp/InvocationExpressionSignatureHelpProvider.vb b/src/Features/VisualBasic/Portable/SignatureHelp/InvocationExpressionSignatureHelpProvider.vb index b162a59d21f1135eb14c34d12203b41888816db5..158dd9eb5a46b2f9ab173aed561e51d1e4e8fd5f 100644 --- a/src/Features/VisualBasic/Portable/SignatureHelp/InvocationExpressionSignatureHelpProvider.vb +++ b/src/Features/VisualBasic/Portable/SignatureHelp/InvocationExpressionSignatureHelpProvider.vb @@ -114,7 +114,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.SignatureHelp Dim documentationCommentFormattingService = document.GetLanguageService(Of IDocumentationCommentFormattingService)() Dim items = New List(Of SignatureHelpItem) - If memberGroup.Count > 0 Then + If memberGroup.Length > 0 Then items.AddRange(GetMemberGroupItems(invocationExpression, semanticModel, symbolDisplayService, anonymousTypeDisplayService, documentationCommentFormattingService, within, memberGroup, cancellationToken)) End If diff --git a/src/Features/VisualBasic/Portable/UseObjectInitializer/VisualBasicUseObjectInitializerCodeFixProvider.vb b/src/Features/VisualBasic/Portable/UseObjectInitializer/VisualBasicUseObjectInitializerCodeFixProvider.vb index ae6d6d1bc4a77b4a1c917b146130ef8f522d698a..49df106236be60f7be92b2bf2eeeba3a10dd7f33 100644 --- a/src/Features/VisualBasic/Portable/UseObjectInitializer/VisualBasicUseObjectInitializerCodeFixProvider.vb +++ b/src/Features/VisualBasic/Portable/UseObjectInitializer/VisualBasicUseObjectInitializerCodeFixProvider.vb @@ -64,7 +64,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UseObjectInitializer Dim match = matches(i) Dim rightValue = match.Initializer - If i < matches.Count - 1 Then + If i < matches.Length - 1 Then rightValue = rightValue.WithoutTrailingTrivia() End If diff --git a/src/Tools/Source/CompilerGeneratorTools/Source/VisualBasicSyntaxGenerator/Grammar/GrammarGenerator.vb b/src/Tools/Source/CompilerGeneratorTools/Source/VisualBasicSyntaxGenerator/Grammar/GrammarGenerator.vb index 1fa9ef1d889e18b0ebd18c710ef096898430308a..cea8505f202956f0c4be1c0b82e5a8b64eecc067 100644 --- a/src/Tools/Source/CompilerGeneratorTools/Source/VisualBasicSyntaxGenerator/Grammar/GrammarGenerator.vb +++ b/src/Tools/Source/CompilerGeneratorTools/Source/VisualBasicSyntaxGenerator/Grammar/GrammarGenerator.vb @@ -70,7 +70,7 @@ Friend Class GrammarGenerator Return childKinds IsNot Nothing AndAlso childKinds.Count = structureNode.NodeKinds.Count End Function).ToArray() - If correspondingChildren.Count > 0 Then + If correspondingChildren.Length > 0 Then compoundNodes.Add(structureNode) Dim correspondingChildrenKinds = correspondingChildren.ToDictionary( diff --git a/src/Tools/Source/RunTests/Program.cs b/src/Tools/Source/RunTests/Program.cs index c3c357bb6c4b8862fd2031deff7fc935068b3c4d..45efd5c5166ca00462f9e460b8807d964196a61f 100644 --- a/src/Tools/Source/RunTests/Program.cs +++ b/src/Tools/Source/RunTests/Program.cs @@ -107,7 +107,7 @@ private static async Task RunCore(Options options, CancellationToken cancel ConsoleUtil.WriteLine($"Data Storage: {testExecutor.DataStorage.Name}"); ConsoleUtil.WriteLine($"Proc dump location: {options.ProcDumpDirectory}"); - ConsoleUtil.WriteLine($"Running {options.Assemblies.Count()} test assemblies in {assemblyInfoList.Count} partitions"); + ConsoleUtil.WriteLine($"Running {options.Assemblies.Count} test assemblies in {assemblyInfoList.Count} partitions"); var result = await testRunner.RunAllAsync(assemblyInfoList, cancellationToken).ConfigureAwait(true); var elapsed = DateTime.Now - start; diff --git a/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs b/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs index c6c8adaa1f58154392a6e94eae9ee99c1c43fb87..31890cccd5acf23335263169fe926d37491d93cd 100644 --- a/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs +++ b/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/FixAllState.cs @@ -115,7 +115,7 @@ internal string GetDefaultFixAllTitle() { var diagnosticIds = this.DiagnosticIds; string diagnosticId; - if (diagnosticIds.Count() == 1) + if (diagnosticIds.Count == 1) { diagnosticId = diagnosticIds.Single(); } diff --git a/src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolver.cs b/src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolver.cs index 7631a2615cde9389aa23098d710ceb8c8f36d19f..6b6019fe87e5a3862f7f137d1a8ac02b53d772d0 100644 --- a/src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolver.cs +++ b/src/Workspaces/Core/Portable/Rename/ConflictEngine/ConflictResolver.cs @@ -328,11 +328,11 @@ private static void AddConflictingSymbolLocations(IEnumerable conflicti var location = await GetSymbolLocationAsync(solution, symbol, cancellationToken).ConfigureAwait(false); if (location != null && location.IsInSource) { - renameDeclarationLocations[symbolIndex] = new RenameDeclarationLocationReference(solution.GetDocumentId(location.SourceTree), location.SourceSpan, overriddenFromMetadata, locations.Count()); + renameDeclarationLocations[symbolIndex] = new RenameDeclarationLocationReference(solution.GetDocumentId(location.SourceTree), location.SourceSpan, overriddenFromMetadata, locations.Length); } else { - renameDeclarationLocations[symbolIndex] = new RenameDeclarationLocationReference(GetString(symbol), locations.Count()); + renameDeclarationLocations[symbolIndex] = new RenameDeclarationLocationReference(GetString(symbol), locations.Length); } symbolIndex++; diff --git a/src/Workspaces/Core/Portable/Rename/ConflictEngine/DeclarationConflictHelpers.cs b/src/Workspaces/Core/Portable/Rename/ConflictEngine/DeclarationConflictHelpers.cs index 43ca945f9505223d8ccaa1e4d82b73fd1658791b..9e9e50d87567b394c8d5a9c1f2fa70efa2227957 100644 --- a/src/Workspaces/Core/Portable/Rename/ConflictEngine/DeclarationConflictHelpers.cs +++ b/src/Workspaces/Core/Portable/Rename/ConflictEngine/DeclarationConflictHelpers.cs @@ -27,7 +27,7 @@ public static ImmutableArray GetMembersWithConflictingSignatures(IProp var potentiallyConfictingProperties = renamedProperty.ContainingType.GetMembers(renamedProperty.Name) .OfType() - .Where(m => !m.Equals(renamedProperty) && m.Parameters.Count() == renamedProperty.Parameters.Count()); + .Where(m => !m.Equals(renamedProperty) && m.Parameters.Length == renamedProperty.Parameters.Length); return GetConflictLocations(renamedProperty, potentiallyConfictingProperties, isMethod: false, (property) => GetAllSignatures((property as IPropertySymbol).Parameters, trimOptionalParameters));