Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for NET 8 analyzers #419

Merged
merged 1 commit into from
Nov 13, 2023
Merged

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Nov 13, 2023

Another set of tweaks that NET 8 analyzers complain about.

@lahma lahma merged commit defee5d into sebastienros:main Nov 13, 2023
2 checks passed
@lahma lahma deleted the net8-analyzers branch November 13, 2023 17:55
@@ -26,7 +28,7 @@ public override string ToString()
writer.WriteLineComment(Value, JavaScriptTextWriter.TriviaFlags.None);
break;
case CommentType.Block:
writer.WriteBlockComment(Value.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None), JavaScriptTextWriter.TriviaFlags.None);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅

@@ -198,6 +198,14 @@ internal static bool Contains(this string source, char c)
}
#endif

#if NETFRAMEWORK || NETSTANDARD2_0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note on newer versions it uses vectorization (you know). We might want to use these and IndexOf as much as possible. I believe it's a jit thing though so it shouldn't require custom tfms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think the interesting case is to detect whether string contains something before doing replace, like in https://github.com/RicoSuter/NJsonSchema/pull/1638/files . It's not ideal with current TFMs, but maybe SearchValues would fit the bill nicely - just to check something before doing and expensive chain of replaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants