Index at 0 instead of using LINQ's First
This commit is contained in:
@@ -531,7 +531,7 @@ namespace OpenRA
|
||||
if (string.IsNullOrEmpty(value))
|
||||
return null;
|
||||
|
||||
var innerType = fieldType.GetGenericArguments().First();
|
||||
var innerType = fieldType.GetGenericArguments()[0];
|
||||
var innerValue = GetValue("Nullable<T>", innerType, value, field);
|
||||
return fieldType.GetConstructor(new[] { innerType }).Invoke(new[] { innerValue });
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
.Where(t => t.Value.Length > 0)
|
||||
.ToDictionary(
|
||||
t => t.Key,
|
||||
t => t.Value.Select(f => (f.Name, f, Utility.GetCustomAttributes<TranslationReferenceAttribute>(f, true).First())).ToArray());
|
||||
t => t.Value.Select(f => (f.Name, f, Utility.GetCustomAttributes<TranslationReferenceAttribute>(f, true)[0])).ToArray());
|
||||
|
||||
foreach (var filename in modData.Manifest.ChromeLayout)
|
||||
{
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace OpenRA.Platforms.Default
|
||||
throw new InvalidOperationException("No supported OpenGL profiles were found.");
|
||||
}
|
||||
|
||||
profile = supportedProfiles.Contains(requestProfile) ? requestProfile : supportedProfiles.First();
|
||||
profile = supportedProfiles.Contains(requestProfile) ? requestProfile : supportedProfiles[0];
|
||||
|
||||
// Note: This must be called after the CanCreateGLWindow checks above,
|
||||
// which needs to create and destroy its own SDL contexts as a workaround for specific buggy drivers
|
||||
|
||||
Reference in New Issue
Block a user