| 609 | |
| 610 | template<typename TKeyRef, typename TValueRef> |
| 611 | void UpdateImpl(TKeyRef&& key, TValueRef&& value) { |
| 612 | if (MultiValue) |
| 613 | ythrow yexception() << "TCache: can't \"Update\" in multicache"; |
| 614 | TIterator it = Find(key); |
| 615 | if (it != End()) { |
| 616 | Erase(it); |
| 617 | } |
| 618 | InsertImpl(std::forward<TKeyRef>(key), std::forward<TValueRef>(value)); |
| 619 | |
| 620 | Y_ASSERT(Index.size() == List.GetSize()); |
| 621 | } |
| 622 | |
| 623 | void Update(const TKey& key, const TValue& value) { |
| 624 | UpdateImpl(key, value); |
nothing calls this directly
no test coverage detected