Improve some String.Split calls.

This commit is contained in:
RoosterDragon
2024-11-13 18:53:34 +00:00
committed by Pavel Penev
parent cf7f57252e
commit bf7f81b7fe
6 changed files with 7 additions and 7 deletions

View File

@@ -149,7 +149,7 @@ namespace OpenRA.Scripting
// Remove the namespace and the trailing "Info"
return types.SelectMany(i => i.GetGenericArguments())
.Select(g => g.Name.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault())
.Select(g => g.Name.Split('.', StringSplitOptions.RemoveEmptyEntries).LastOrDefault())
.Select(s => s.EndsWith("Info", StringComparison.Ordinal) ? s.Remove(s.Length - 4, 4) : s)
.ToArray();
}