| 469 | |
| 470 | template <typename Func1, typename Func2> |
| 471 | int32_t GetOrInsertNull(Func1&& on_found, Func2&& on_not_found) { |
| 472 | int32_t memo_index = GetNull(); |
| 473 | if (memo_index != kKeyNotFound) { |
| 474 | on_found(memo_index); |
| 475 | } else { |
| 476 | null_index_ = memo_index = size(); |
| 477 | on_not_found(memo_index); |
| 478 | } |
| 479 | return memo_index; |
| 480 | } |
| 481 | |
| 482 | int32_t GetOrInsertNull() { |
| 483 | return GetOrInsertNull([](int32_t i) {}, [](int32_t i) {}); |