(bm blob.Metadata)
| 251 | } |
| 252 | |
| 253 | func (h *contentMetadataHeap) AddOrUpdate(bm blob.Metadata) { |
| 254 | if i, exists := h.index[bm.BlobID]; exists { |
| 255 | // only accept newer timestamps |
| 256 | if bm.Timestamp.After(h.data[i].Timestamp) { |
| 257 | h.totalDataBytes += bm.Length - h.data[i].Length |
| 258 | h.data[i] = bm |
| 259 | heap.Fix(h, i) |
| 260 | } |
| 261 | } else { |
| 262 | heap.Push(h, bm) |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | func (h *contentMetadataHeap) Pop() any { |
| 267 | old := h.data |
no test coverage detected