Skip to content

Commit ebb917c

Browse files
committed
Prefer Contains() over IndexOf() >= 0
1 parent a4c92ec commit ebb917c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

OnTopic.Editor.AspNetCore/Components/FilePathViewComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public string GetPath(string attributeKey, FilePathAttributeTopicViewModel optio
226226
/*------------------------------------------------------------------------------------------------------------------------
227227
| Replace path slashes with backslashes if the resulting file path value uses a UNC or basic file path format
228228
\-----------------------------------------------------------------------------------------------------------------------*/
229-
if (filePath.IndexOf("\\", StringComparison.InvariantCulture) >= 0) {
229+
if (filePath.Contains("\\", StringComparison.InvariantCulture)) {
230230
filePath = filePath.Replace("/", "\\");
231231
}
232232

0 commit comments

Comments
 (0)