Merge `Where` calls

fixes 0d02d5c49 and e7884f679
This commit is contained in:
YoshiRulz 2023-02-08 23:40:15 +10:00
parent eafb1fdcf5
commit b14a741ffe
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 5 additions and 6 deletions

View File

@ -18,13 +18,12 @@ namespace BizHawk.Client.EmuHawk
=> Properties.Resources.ToolBoxIcon;
private static readonly Lazy<IReadOnlyCollection<Type>> ToolTypes = new(() => EmuHawk.ReflectionCache.Types
.Where(static t => typeof(IToolForm).IsAssignableFrom(t) && typeof(Form).IsAssignableFrom(t))
#if DEBUG
.Where(static t => t.Namespace is not "BizHawk.Client.EmuHawk.ForDebugging")
.Where(static t => typeof(IToolForm).IsAssignableFrom(t) && typeof(Form).IsAssignableFrom(t)
#if DEBUG // these tools are simply not compiled in Release config
&& t.Namespace is not "BizHawk.Client.EmuHawk.ForDebugging"
#endif
.Where(VersionInfo.DeveloperBuild
? static t => true
: static t => !t.GetCustomAttributes(false).OfType<ToolAttribute>().Any(static a => !a.Released))
&& (VersionInfo.DeveloperBuild
|| !t.GetCustomAttributes(false).OfType<ToolAttribute>().Any(static a => !a.Released)))
.Except(new[] { typeof(ToolBox), typeof(ToolFormBase) }).ToList());
[RequiredService]