mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
chore(GuildMemberRoleManager): Remove unnecessary !prev check (#6781)
Co-authored-by: Bas950 <bas.van.zanten007@gmail.com> Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
@@ -44,7 +44,7 @@ class GuildMemberRoleManager extends DataManager {
|
|||||||
get hoist() {
|
get hoist() {
|
||||||
const hoistedRoles = this.cache.filter(role => role.hoist);
|
const hoistedRoles = this.cache.filter(role => role.hoist);
|
||||||
if (!hoistedRoles.size) return null;
|
if (!hoistedRoles.size) return null;
|
||||||
return hoistedRoles.reduce((prev, role) => (!prev || role.comparePositionTo(prev) > 0 ? role : prev));
|
return hoistedRoles.reduce((prev, role) => (role.comparePositionTo(prev) > 0 ? role : prev));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +66,7 @@ class GuildMemberRoleManager extends DataManager {
|
|||||||
get color() {
|
get color() {
|
||||||
const coloredRoles = this.cache.filter(role => role.color);
|
const coloredRoles = this.cache.filter(role => role.color);
|
||||||
if (!coloredRoles.size) return null;
|
if (!coloredRoles.size) return null;
|
||||||
return coloredRoles.reduce((prev, role) => (!prev || role.comparePositionTo(prev) > 0 ? role : prev));
|
return coloredRoles.reduce((prev, role) => (role.comparePositionTo(prev) > 0 ? role : prev));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user