From 40b3888dcbcf72903057ae3f6adeb9210656455f Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 14 Apr 2016 17:34:00 -0700 Subject: [PATCH] Revert use of foreach in ALC I forgot to revert this in #814, thanks @daxian-dbw for the pointer. --- .../CoreCLR/CorePsAssemblyLoadContext.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs index 106cf402a5..c1e0e75220 100644 --- a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/CoreCLR/CorePsAssemblyLoadContext.cs @@ -141,8 +141,9 @@ namespace System.Management.Automation string asmCultureName = assemblyName.CultureName ?? string.Empty; string asmFilePath = null; - foreach (var probingPath in probingPaths) + for (int i = 0; i < probingPaths.Count; i++) { + string probingPath = probingPaths[i]; string asmCulturePath = Path.Combine(probingPath, asmCultureName); for (int k = 0; k < extensions.Length; k++) {