feat(Util): add SweptCollection for auto sweeping of caches (#6110)

Co-authored-by: DTrombett <73136330+DTrombett@users.noreply.github.com>
Co-authored-by: 1Computer1 <22125769+1Computer1@users.noreply.github.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: NotSugden <28943913+NotSugden@users.noreply.github.com>
Co-authored-by: Shino <shinotheshino@gmail.com>
Co-authored-by: SpaceEEC <24881032+SpaceEEC@users.noreply.github.com>
Co-authored-by: Noel <icrawltogo@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
ckohen
2021-07-30 14:57:46 -07:00
committed by GitHub
parent 2675b0866c
commit dbb59ba1b2
16 changed files with 281 additions and 31 deletions

View File

@@ -72,7 +72,7 @@ class GuildEmojiRoleManager extends DataManager {
resolvedRoleIds.push(roleId);
}
const newRoles = this.cache.keyArray().filter(id => !resolvedRoleIds.includes(id));
const newRoles = [...this.cache.keys()].filter(id => !resolvedRoleIds.includes(id));
return this.set(newRoles);
}
@@ -97,7 +97,7 @@ class GuildEmojiRoleManager extends DataManager {
clone() {
const clone = new this.constructor(this.emoji);
clone._patch(this.cache.keyArray().slice());
clone._patch([...this.cache.keys()]);
return clone;
}