Andrew Gillis 9 vuotta sitten
vanhempi
commit
04e142afea
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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")