← All recipes
Moderne licensed

Find Span<char> equality that should use SequenceEqual

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Performance.FindSequenceEqualForSpanArtifactOpenRewrite.Recipes.CSharp.CodeQuality

Detect == and != operators on Span<char> or ReadOnlySpan<char> which compare references. Use SequenceEqual for content comparison.

Single recipecsharpperformancecode-qualityProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Performance.FindSequenceEqualForSpan

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality