foreach (var cl in compFileName)
{
foreach (var f in fileArray)
{
if (f.Contains(cl))
{
compToCopy.Add(f);
}
}
(sender as BackgroundWorker).ReportProgress(i, Convert.ToString(i));
i++;I'm wondering if there is a more efficient way rather than doing a loop within a loop as even with just 30,000 in the list it takes some time to iterate through!
VulpesPosted Sep 9, 2014, 12:35 PM
If it isn't, then you could break from the inner loop after finding a match.
Jay SPosted Sep 9, 2014, 1:45 PM