| 605 | |
| 606 | template <typename Func1, typename Func2> |
| 607 | int32_t GetOrInsertNull(Func1&& on_found, Func2&& on_not_found) { |
| 608 | auto memo_index = GetNull(); |
| 609 | if (memo_index == kKeyNotFound) { |
| 610 | memo_index = value_to_index_[cardinality] = size(); |
| 611 | index_to_value_.push_back(0); |
| 612 | on_not_found(memo_index); |
| 613 | } else { |
| 614 | on_found(memo_index); |
| 615 | } |
| 616 | return memo_index; |
| 617 | } |
| 618 | |
| 619 | int32_t GetOrInsertNull() { |
| 620 | return GetOrInsertNull([](int32_t i) {}, [](int32_t i) {}); |