File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/System.Management.Automation/engine Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 9
9
using System . Diagnostics . CodeAnalysis ;
10
10
using System . Globalization ;
11
11
using System . IO ;
12
- using System . Linq ;
13
12
using System . Linq . Expressions ;
14
13
using System . Management . Automation . Internal ;
15
14
using System . Management . Automation . Language ;
@@ -339,12 +338,13 @@ internal static void UpdateTypeConvertFromTypeTable(string typeName)
339
338
{
340
339
lock ( s_converterCache )
341
340
{
342
- var toRemove = s_converterCache . Keys . Where (
343
- conv => string . Equals ( conv . to . FullName , typeName , StringComparison . OrdinalIgnoreCase ) ||
344
- string . Equals ( conv . from . FullName , typeName , StringComparison . OrdinalIgnoreCase ) ) . ToArray ( ) ;
345
- foreach ( var k in toRemove )
341
+ foreach ( var key in s_converterCache . Keys )
346
342
{
347
- s_converterCache . Remove ( k ) ;
343
+ if ( string . Equals ( key . to . FullName , typeName , StringComparison . OrdinalIgnoreCase )
344
+ || string . Equals ( key . from . FullName , typeName , StringComparison . OrdinalIgnoreCase ) )
345
+ {
346
+ s_converterCache . Remove ( key ) ;
347
+ }
348
348
}
349
349
350
350
// Note we do not clear possibleTypeConverter even when removing.
You can’t perform that action at this time.
0 commit comments