diff --git a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/UseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/UseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs index e9b9047c57..836cffdb03 100644 --- a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/UseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs +++ b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/UseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs @@ -51,7 +51,7 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) // https://learn.microsoft.com/dotnet/api/system.memoryextensions.startswith?view=net-7.0#system-memoryextensions-startswith(system-readonlyspan((system-char))-system-readonlyspan((system-char))-system-stringcomparison) // VB: Use a.StartsWith(c.ToString(), stringComparison) case UseStartsWithInsteadOfIndexOfComparisonWithZero.OverloadChar_StringComparison: - return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(node, AppendElasticMarker(HandleCharStringComparisonOverload(generator, instance, arguments, shouldNegate))))); + return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(node, HandleCharStringComparisonOverload(generator, instance, arguments, shouldNegate)))); // If 'StartsWith(char)' is available, use it. Otherwise check '.Length > 0 && [0] == ch' // For negation, we use '.Length == 0 || [0] != ch'