Improve some String.Split calls.
This commit is contained in:
committed by
Pavel Penev
parent
cf7f57252e
commit
bf7f81b7fe
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user