Andrew Gillis %!s(int64=9) %!d(string=hai) anos
pai
achega
04e142afea
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      queue.go

+ 1 - 1
queue.go

@@ -71,7 +71,7 @@ func (q *Queue) Peek() interface{} {
 func (q *Queue) Get(i int) interface{} {
 	// If indexing backwards, convert to positive index.
 	if i < 0 {
-		i = q.count + i
+		i += q.count
 	}
 	if i < 0 || i >= q.count {
 		panic("queue: Get() called with index out of range")