| 647 | } |
| 648 | |
| 649 | void Clear() { |
| 650 | for (TIndexIterator it = Index.begin(); it != Index.end(); ++it) { |
| 651 | TItem* item = const_cast<TItem*>(&*it); |
| 652 | List.Erase(item); |
| 653 | TDeleter::Destroy(item->Value); |
| 654 | } |
| 655 | Y_ASSERT(List.GetSize() == 0); |
| 656 | Index.clear(); |
| 657 | } |
| 658 | |
| 659 | void SetMaxSize(size_t newSize) { |
| 660 | List.SetMaxSize(newSize); |