diff --git a/queue.go b/queue.go index 5eef029..35bb896 100644 --- a/queue.go +++ b/queue.go @@ -66,8 +66,7 @@ if i >= q.Length() || i < 0 { panic("queue: index out of range") } - modi := (q.head + i) % len(q.buf) - return q.buf[modi] + return q.buf[(q.head+i)%len(q.buf)] } // Remove removes the element from the front of the queue. If you actually