- for (const auto& pair : smpi_colors) { // Is an entry of our map a substring of this state name?
- if (std::strstr(state.c_str(), pair.first.c_str()) != nullptr)
- return pair.second.c_str();
+ for (const auto& [smpi_state, color] : smpi_colors) { // Is an entry of our map a substring of this state name?
+ if (state.find(smpi_state) != std::string::npos)
+ return color.c_str();