Skip to content

Commit

Permalink
refactor: separate condition in two if
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed Jul 9, 2023
1 parent 7bbe74b commit 7895219
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/discord.js/src/structures/GuildChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ class GuildChannel extends BaseChannel {

let count = 0;
for (const channel of this.guild.channels.cache.values()) {
if (!types.includes(channel.type) || (!selfIsCategory && channel.parentId !== this.parentId)) continue;
if (!types.includes(channel.type)) continue;
if (!selfIsCategory && channel.parentId !== this.parentId) continue;
if (this.rawPosition === channel.rawPosition) {
if (Snowflake.compare(channel.id, this.id) === -1) count++;
} else if (this.rawPosition > channel.rawPosition) {
Expand Down

0 comments on commit 7895219

Please sign in to comment.