Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
Quickest Loop within a Loop
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Jay S
10y
743
1
Reply
Currently I have a Loop with in a Loop to find if sometime in a List is contained within a string array:
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!
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
C# update active directory groups
Logic for this operation