From 167b826f3a9f34275e6fd120e4942474487a576b Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Sat, 17 Dec 2022 13:33:51 +0200 Subject: [PATCH] Revert "Try with elastic marker" This reverts commit e42cc0845380e512f80c72861019cee2579c9514. --- .../UseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'