perf(cmd): remove redundant slice

This commit is contained in:
ayn2op 2025-07-28 18:46:05 -04:00
parent addfb3f949
commit 18eb50fa2c

View file

@ -142,17 +142,12 @@ func (gt *guildsTree) createChannelNode(node *tview.TreeNode, channel discord.Ch
}
func (gt *guildsTree) createChannelNodes(node *tview.TreeNode, channels []discord.Channel) {
var orphanChs []discord.Channel
for _, ch := range channels {
if ch.Type != discord.GuildCategory && !ch.ParentID.IsValid() {
orphanChs = append(orphanChs, ch)
for _, channel := range channels {
if channel.Type != discord.GuildCategory && !channel.ParentID.IsValid() {
gt.createChannelNode(node, channel)
}
}
for _, c := range orphanChs {
gt.createChannelNode(node, c)
}
PARENT_CHANNELS:
for _, c := range channels {
if c.Type == discord.GuildCategory {