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