Skip to content

Commit

Permalink
feat: apply CA1847: Use char literal for a single character lookup
Browse files Browse the repository at this point in the history
String.Contains(char) offers better performance than
String.Contains(string).
  • Loading branch information
shpaass committed May 7, 2024
1 parent 4766fdf commit 871acd7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ dotnet_diagnostic.IDE0270.severity = none
# SYSLIB1045: Convert to 'GeneratedRegexAttribute'.
dotnet_diagnostic.SYSLIB1045.severity = none

# CA1847: Use char literal for a single character lookup
dotnet_diagnostic.CA1847.severity = none

# CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1859.severity = none

Expand Down
2 changes: 1 addition & 1 deletion Yafc.Parser/FactorioDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static ReadOnlySpan<byte> CleanupBom(this ReadOnlySpan<byte> span) {
public static (string mod, string path) ResolveModPath(string currentMod, string fullPath, bool isLuaRequire = false) {
string mod = currentMod;
char[] splitters = fileSplittersNormal;
if (isLuaRequire && !fullPath.Contains("/")) {
if (isLuaRequire && !fullPath.Contains('/')) {
splitters = fileSplittersLua;
}

Expand Down

0 comments on commit 871acd7

Please sign in to comment.