| 182 | } |
| 183 | |
| 184 | bool Insert(T value) { |
| 185 | TNode* node = PrepareInsert(value); |
| 186 | if (Y_UNLIKELY(node && Compare(node, value) == 0)) { |
| 187 | // we do not allow duplicates |
| 188 | return false; |
| 189 | } |
| 190 | node = DoInsert(std::move(value)); |
| 191 | TCounter::OnInsert(node->GetValue()); |
| 192 | return true; |
| 193 | } |
| 194 | |
| 195 | template <typename TInsertAction, typename TUpdateAction> |
| 196 | bool Insert(const T& value, TInsertAction insert, TUpdateAction update) { |
no test coverage detected