Skip to content

Commit

Permalink
队列增加Clear
Browse files Browse the repository at this point in the history
  • Loading branch information
davyxu committed Jun 28, 2019
1 parent 1807d25 commit a644d24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func (self *Queue) Dequeue() (ret interface{}) {
return
}

func (self *Queue) Clear() {
self.list = self.list[0:0]
}

func NewQueue(size int) *Queue {

return &Queue{
Expand Down

0 comments on commit a644d24

Please sign in to comment.