mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
arrayqueue: Fix bug in Back() method (#313)
This commit is contained in:
committed by
GitHub
parent
a3a24fc381
commit
c176ba378e
@@ -60,7 +60,7 @@ func (q *ArrayQueue[T]) Front() T {
|
|||||||
|
|
||||||
// Back return back value of queue
|
// Back return back value of queue
|
||||||
func (q *ArrayQueue[T]) Back() T {
|
func (q *ArrayQueue[T]) Back() T {
|
||||||
return q.data[q.size-1]
|
return q.data[q.tail-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnQueue put element into queue
|
// EnQueue put element into queue
|
||||||
|
|||||||
Reference in New Issue
Block a user