addIfNotPresentLocked assumes the lock is already held and adds the provided item to the queue if it does not already exist.
(key string, obj interface{})
| 207 | // addIfNotPresentLocked assumes the lock is already held and adds the provided |
| 208 | // item to the queue if it does not already exist. |
| 209 | func (h *Heap) addIfNotPresentLocked(key string, obj interface{}) { |
| 210 | if _, exists := h.data.items[key]; exists { |
| 211 | return |
| 212 | } |
| 213 | heap.Push(h.data, &itemKeyValue{key, obj}) |
| 214 | } |
| 215 | |
| 216 | // Update is the same as Add in this implementation. When the item does not |
| 217 | // exist, it is added. |
no test coverage detected