@@ -3582,7 +3582,7 @@ where localType.IsAssignableFrom(implementationType)
35823582 }
35833583
35843584 // TODO - find a better way to remove "system" assemblies from the auto registration
3585- private readonly List < Func < Assembly , bool > > ignoredAssemlies = new List < Func < Assembly , bool > > ( )
3585+ private static readonly IReadOnlyList < Func < Assembly , bool > > ignoredAssemlies = new List < Func < Assembly , bool > > ( )
35863586 {
35873587 asm => asm . FullName . StartsWith ( "Microsoft." , StringComparison . Ordinal ) ,
35883588 asm => asm . FullName . StartsWith ( "System." , StringComparison . Ordinal ) ,
@@ -3604,9 +3604,9 @@ private bool IsIgnoredAssembly(Assembly assembly)
36043604
36053605 return false ;
36063606 }
3607-
3607+
36083608 // TODO - find a better way to remove "system" types from the auto registration
3609- private readonly List < Func < Type , bool > > ignoreChecks = new List < Func < Type , bool > > ( )
3609+ private static readonly IReadOnlyList < Func < Type , bool > > ignoreChecks = new List < Func < Type , bool > > ( )
36103610 {
36113611 t => t . FullName . StartsWith ( "System." , StringComparison . Ordinal ) ,
36123612 t => t . FullName . StartsWith ( "Microsoft." , StringComparison . Ordinal ) ,
@@ -3619,19 +3619,10 @@ private bool IsIgnoredAssembly(Assembly assembly)
36193619
36203620 private bool IsIgnoredType ( Type type , Func < Type , bool > registrationPredicate )
36213621 {
3622- if ( registrationPredicate != null && ! registrationPredicate ( type ) )
3623- {
3624- ignoreChecks . Add ( t => ! registrationPredicate ( t ) ) ;
3622+ if ( ignoreChecks . Any ( c => c ( type ) ) )
36253623 return true ;
3626- }
36273624
3628- for ( int i = 0 ; i < ignoreChecks . Count ; i ++ )
3629- {
3630- if ( ignoreChecks [ i ] ( type ) )
3631- return true ;
3632- }
3633-
3634- return false ;
3625+ return registrationPredicate != null && ! registrationPredicate ( type ) ;
36353626 }
36363627
36373628 private void RegisterDefaultTypes ( )
0 commit comments