| 92 | } |
| 93 | |
| 94 | std::optional<Id> Find(Id id) const override { |
| 95 | std::optional<std::string_view> maybe_owned_uri = FindUri(id.uri); |
| 96 | if (!maybe_owned_uri) { |
| 97 | return std::nullopt; |
| 98 | } |
| 99 | |
| 100 | auto name_itr = names_.find(id.name); |
| 101 | if (name_itr == names_.end()) { |
| 102 | return std::nullopt; |
| 103 | } else { |
| 104 | return Id{*maybe_owned_uri, *name_itr}; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | std::optional<std::string_view> FindUri(std::string_view uri) const override { |
| 109 | auto uri_itr = uris_.find(uri); |