Handle known enumerable types better

This commit is contained in:
Matt Nadareski
2024-11-12 21:12:06 -05:00
parent 4b3955af77
commit a4da7f3657
19 changed files with 227 additions and 178 deletions

View File

@@ -1,5 +1,4 @@
using System;
using System.Linq;
namespace SabreTools.Core.Tools
{
@@ -32,7 +31,7 @@ namespace SabreTools.Core.Tools
return null;
// Get the enum value info from the array, if possible
var enumValueMemberInfo = memberInfos.FirstOrDefault(m => m.DeclaringType == enumType);
var enumValueMemberInfo = Array.Find(memberInfos, m => m.DeclaringType == enumType);
if (enumValueMemberInfo == null)
return null;
@@ -42,7 +41,7 @@ namespace SabreTools.Core.Tools
return null;
// Return the first attribute, if possible
return (MappingAttribute?)attributes.FirstOrDefault();
return (MappingAttribute?)attributes[0];
}
}
}