func (q *UniqueQueue) Replace(value TimedValue) bool {
	q.lock.Lock()
	defer q.lock.Unlock()

	for i := range q.queue {
		if q.queue[i].Value != value.Value {
			continue
		}
		heap.Remove(&q.queue, i)
		heap.Push(&q.queue, &value)
		return true
	}
	return false
}
// Replace replaces an existing value in the queue if it already
// exists, otherwise it does nothing. Returns true if the item was
// found.
Replace replaces an existing value in the queue if it already
exists, otherwise it does nothing. Returns true if the item was
found.
// Replace replaces an existing value in the queue if it already // exists otherwise it does nothing . Returns true if the item was // found .
func (q *UniqueQueue) Replace(value TimedValue) bool {
	q.lock.Lock()
	defer q.lock.Unlock()
	for i := range q.queue {
		if q.queue[i].Value != value.Value {
			continue
		}
		heap.Remove(&q.queue, i)
		heap.Push(&q.queue, &value)
		return true
	}
	return false
}
func ( q * UniqueQueue ) Replace ( value TimedValue ) bool { q . lock . Lock ( ) defer q . lock . Unlock ( ) for i := range q . queue { if q . queue [ i ] . Value != value . Value { continue } heap . Remove ( & q . queue , i ) heap . Push ( & q . queue , & value ) return true } return false }
Replace replaces an existing value in the queue if it already
exists, otherwise it does nothing.
Replace replaces an existing value in the queue if it already exists otherwise it does nothing .