| 46 | } |
| 47 | |
| 48 | List<TenantPtr> TenantDatabase::getMatchingTenants(StringMap<unsigned> const& colonyTags) const { |
| 49 | // This implementation loops over every tenant. Smarter implementations could |
| 50 | // be written if it becomes a bottleneck, depending on how colonyTags end up |
| 51 | // being |
| 52 | // used, how many there are, how many tenants have similar criteria, etc. |
| 53 | List<TenantPtr> matchingTenants; |
| 54 | for (String const& name : m_paths.keys()) { |
| 55 | TenantPtr tenant = getTenant(name); |
| 56 | if (tenant->criteriaSatisfied(colonyTags)) |
| 57 | matchingTenants.append(tenant); |
| 58 | } |
| 59 | return matchingTenants; |
| 60 | } |
| 61 | |
| 62 | TenantPtr TenantDatabase::readTenant(String const& path) { |
| 63 | try { |
nothing calls this directly
no test coverage detected