mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-14 07:34:43 +08:00
queue add RLockRange method.
This commit is contained in:
@@ -78,7 +78,7 @@ func (q *Queue) Get(i int) interface{} {
|
||||
i += q.count
|
||||
}
|
||||
if i < 0 || i >= q.count {
|
||||
panic("queue: Get() called with index out of range")
|
||||
return nil
|
||||
}
|
||||
// bitwise modulus
|
||||
return q.buf[(q.head+i)&(len(q.buf)-1)]
|
||||
|
||||
Reference in New Issue
Block a user