| 65 | } |
| 66 | |
| 67 | absl::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 | |
| 77 | DataTable &DataTableManager::operator[](const std::string_view name) { return getDataTable(name); } |
| 78 |