mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 09:29:38 +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)
|
||||
// Technically we could bq.queue = nil, but this would cost
|
||||
// another if in Run().
|
||||
for i := 0; i < len(bq.queue); i++ {
|
||||
bq.queue[i] = nil
|
||||
}
|
||||
clear(bq.queue)
|
||||
bq.len = 0
|
||||
bq.queueLock.Unlock()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue