added early out for redundant assignment

This commit is contained in:
phyzical 2022-02-12 00:13:56 +08:00
parent 8b55b0293c
commit 51d10290d2

@ -184,6 +184,7 @@ export class OfficeSpace {
} }
} }
if (jobCount == amount) return false;
if ((jobCount + unassignedCount) < amount) return false; if ((jobCount + unassignedCount) < amount) return false;
for (let i = 0; i < this.employees.length; ++i) { for (let i = 0; i < this.employees.length; ++i) {