MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / getMatchingTenants

Method getMatchingTenants

source/game/StarTenantDatabase.cpp:48–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48List<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
62TenantPtr TenantDatabase::readTenant(String const& path) {
63 try {

Callers

nothing calls this directly

Calls 3

criteriaSatisfiedMethod · 0.80
keysMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected