فهرست منبع

Minor simplification

Evan Huus 11 سال پیش
والد
کامیت
6770be2743
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      queue.go

+ 1 - 2
queue.go

@@ -66,8 +66,7 @@ func (q *Queue) Get(i int) interface{} {
 	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