mirror of
https://github.com/Xpl0itU/WiiUDownloader.git
synced 2025-05-09 13:52:02 -04:00
Make a copy of the queue for iterating and removing
This commit is contained in:
parent
bb41e9612f
commit
6c1ccae2c6
1 changed files with 3 additions and 1 deletions
|
@ -191,7 +191,9 @@ func (qp *QueuePane) IsTitleInQueue(title wiiudownloader.TitleEntry) bool {
|
|||
}
|
||||
|
||||
func (qp *QueuePane) ForEachRemoving(f func(wiiudownloader.TitleEntry)) {
|
||||
for _, title := range qp.titleQueue {
|
||||
titleQueueCopy := make([]wiiudownloader.TitleEntry, len(qp.titleQueue))
|
||||
copy(titleQueueCopy, qp.titleQueue)
|
||||
for _, title := range titleQueueCopy {
|
||||
f(title)
|
||||
qp.RemoveTitle(title)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue