MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / buildIndexBy

Method buildIndexBy

src/OD2/Common/DataTableManager.cpp:67–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67absl::flat_hash_map<std::string, int> DataTableManager::buildIndexBy(std::string_view name, std::string_view column) {
68 const auto& table = getDataTable(name);
69 absl::flat_hash_map<std::string, int> result;
70 for (int i = 0; i < table.size(); ++i) {
71 const auto& row = table[i];
72 result[row.at(column)] = i;
73 }
74 return result;
75}
76
77DataTable &DataTableManager::operator[](const std::string_view name) { return getDataTable(name); }
78

Callers 1

SoundManagerMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected