mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 13:41:47 +00:00
bqueue: simplify queue flush on Discard()
Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
parent
8f45d57612
commit
0fec17d7c0
1 changed files with 1 additions and 3 deletions
|
@ -157,9 +157,7 @@ func (bq *Queue) Discard() {
|
||||||
close(bq.checkBlocks)
|
close(bq.checkBlocks)
|
||||||
// Technically we could bq.queue = nil, but this would cost
|
// Technically we could bq.queue = nil, but this would cost
|
||||||
// another if in Run().
|
// another if in Run().
|
||||||
for i := 0; i < len(bq.queue); i++ {
|
clear(bq.queue)
|
||||||
bq.queue[i] = nil
|
|
||||||
}
|
|
||||||
bq.len = 0
|
bq.len = 0
|
||||||
bq.queueLock.Unlock()
|
bq.queueLock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue