Using a Set for groups

This commit is contained in:
David Négrier 2020-06-29 22:13:07 +02:00
parent 4fee1ac206
commit 31846d1640
2 changed files with 7 additions and 7 deletions

View file

@ -68,7 +68,7 @@ export class Group {
leave(user: UserInterface): void
{
let success = this.users.delete(user);
const success = this.users.delete(user);
if (success === false) {
throw new Error("Could not find user "+user.id+" in the group "+this.id);
}
@ -84,7 +84,7 @@ export class Group {
*/
destroy(): void
{
for (let user of this.users) {
for (const user of this.users) {
this.leave(user);
}
}