private List <Task <(bool result, IProject project)> > QueueItems(List <IProject> toBuild, List <IProject> built, BuildRunner runner) { var tasks = new List <Task <(bool result, IProject project)> >(); var toRemove = new List <IProject>(); foreach (var item in toBuild) { bool canBuild = true; foreach (var dep in item.References.OfType <OmniSharpProject>()) { if (!built.Contains(dep)) { canBuild = false; break; } } if (canBuild) { toRemove.Add(item); tasks.Add(runner.Queue(item)); } } foreach (var item in toRemove) { toBuild.Remove(item); } return(tasks); }