perf(cmd): remove redundant slice
This commit is contained in:
parent
addfb3f949
commit
18eb50fa2c
1 changed files with 3 additions and 8 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue