Fix multiple enumeration
This commit is contained in:
parent
13075a8704
commit
d3ccddd8db
@ -62,8 +62,9 @@ public class JobBoss : GlobalBase
|
|||||||
|
|
||||||
public void RemoveJobs(IEnumerable<Job?> jobsToRemove)
|
public void RemoveJobs(IEnumerable<Job?> jobsToRemove)
|
||||||
{
|
{
|
||||||
Log($"Removing {jobsToRemove.Count()} jobs.");
|
List<Job?> toRemove = jobsToRemove.ToList(); //Prevent multiple enumeration
|
||||||
foreach (Job? job in jobsToRemove)
|
Log($"Removing {toRemove.Count()} jobs.");
|
||||||
|
foreach (Job? job in toRemove)
|
||||||
if(job is not null)
|
if(job is not null)
|
||||||
RemoveJob(job);
|
RemoveJob(job);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user